Skip to content

Commit

Permalink
(Upstream) Add LVHashTable::compact()
Browse files Browse the repository at this point in the history
  • Loading branch information
virxkane authored and poire-z committed Aug 27, 2021
1 parent 58839e2 commit f92dba9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crengine/include/lvhashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ template <typename keyT, typename valueT> class LVHashTable
}
return false;
}
void compact()
{
if (_count > 0 && _count < _size)
resize(_count);
}
private:
int _size;
int _count;
Expand Down

0 comments on commit f92dba9

Please sign in to comment.