FlatHashTable: bugfix
This commit is contained in:
parent
500c20f7ea
commit
1a3adc3ee7
@ -55,6 +55,9 @@ class fixed_vector {
|
|||||||
const T *end() const {
|
const T *end() const {
|
||||||
return ptr_ + size_;
|
return ptr_ + size_;
|
||||||
}
|
}
|
||||||
|
bool empty() const {
|
||||||
|
return size() == 0;
|
||||||
|
}
|
||||||
size_t size() const {
|
size_t size() const {
|
||||||
return size_;
|
return size_;
|
||||||
}
|
}
|
||||||
@ -431,7 +434,7 @@ class FlatHashMapImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void grow() {
|
void grow() {
|
||||||
size_t want_size = normalize(2 * nodes_.size() - 1);
|
size_t want_size = normalize(2 * nodes_.size() - !nodes_.empty());
|
||||||
resize(want_size);
|
resize(want_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user