void do_rehash()
{
hashtable.clear();
- hashtable.resize(hashtable_size(entries.size() * hashtable_size_factor), -1);
+ hashtable.resize(hashtable_size(entries.capacity() * hashtable_size_factor), -1);
for (int i = 0; i < int(entries.size()); i++) {
do_assert(-1 <= entries[i].next && entries[i].next < int(entries.size()));
return !operator==(other);
}
+ void reserve(size_t n) { entries.reserve(n); }
size_t size() const { return entries.size(); }
bool empty() const { return entries.empty(); }
void clear() { hashtable.clear(); entries.clear(); }
void do_rehash()
{
hashtable.clear();
- hashtable.resize(hashtable_size(entries.size() * hashtable_size_factor), -1);
+ hashtable.resize(hashtable_size(entries.capacity() * hashtable_size_factor), -1);
for (int i = 0; i < int(entries.size()); i++) {
do_assert(-1 <= entries[i].next && entries[i].next < int(entries.size()));
return !operator==(other);
}
+ void reserve(size_t n) { entries.reserve(n); }
size_t size() const { return entries.size(); }
bool empty() const { return entries.empty(); }
void clear() { hashtable.clear(); entries.clear(); }
database.swap(other.database);
}
+ void reserve(size_t n) { database.reserve(n); }
size_t size() const { return database.size(); }
bool empty() const { return database.empty(); }
void clear() { database.clear(); }
parents.swap(other.parents);
}
+ void reserve(size_t n) { database.reserve(n); }
size_t size() const { return database.size(); }
bool empty() const { return database.empty(); }
void clear() { database.clear(); parents.clear(); }