Optimize FlatHashTable::emplace.
This commit is contained in:
parent
057b2d1e05
commit
cd21f58e7d
@ -478,10 +478,8 @@ class FlatHashTable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void try_grow() {
|
void try_grow() {
|
||||||
if (unlikely(nodes_ == nullptr)) {
|
if (unlikely(used_node_count_ * 5 >= bucket_count_mask_ * 3)) {
|
||||||
resize(8);
|
resize(2 * bucket_count_mask_ + 2 + 6 * (bucket_count_mask_ == 0));
|
||||||
} else if (unlikely(used_node_count_ * 5 > bucket_count_mask_ * 3)) {
|
|
||||||
resize(2 * bucket_count_mask_ + 2);
|
|
||||||
}
|
}
|
||||||
invalidate_iterators();
|
invalidate_iterators();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user