Skip to content

Commit

Permalink
Remove duplicate destructor
Browse files Browse the repository at this point in the history
Destructor of base class GenericVector calls base class clear()
method, deallocating the memory.
  • Loading branch information
pnordhus committed Jun 17, 2016
1 parent 034d666 commit c05ff34
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions dict/dawg.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,6 @@ struct DawgPosition {

class DawgPositionVector : public GenericVector<DawgPosition> {
public:
/// Overload destructor, since clear() does not delete data_[] any more.
~DawgPositionVector() {
if (size_reserved_ > 0) {
delete[] data_;
size_used_ = 0;
size_reserved_ = 0;
}
}
/// Overload clear() in order to avoid allocating/deallocating memory
/// when clearing the vector and re-inserting entries into it later.
void clear() { size_used_ = 0; }
Expand Down

0 comments on commit c05ff34

Please sign in to comment.