Add a special case for erase(begin(), end()) to reset the control bytes. The motivation is to avoid potentially expanding the table unnecessarily later. Note: I prefer doing this as a special case in erase(iterator, iterator) rather than special casing erase(iterator) for size==1 because IIUC that changes the time complexity of erase(iterator) from O(1) to O(N) and in pathological cases, it could change loops from O(N) to O(N^2). PiperOrigin-RevId: 549661855 Change-Id: I8603324260f51a98809db32f840ff09f25cf2481
| Name |
Last commit
|
Last Update |
|---|---|---|
| .. | ||
| internal | Loading commit data... | |
| BUILD.bazel | Loading commit data... | |
| CMakeLists.txt | Loading commit data... | |
| btree_benchmark.cc | Loading commit data... | |
| btree_map.h | Loading commit data... | |
| btree_set.h | Loading commit data... | |
| btree_test.cc | Loading commit data... | |
| btree_test.h | Loading commit data... | |
| fixed_array.h | Loading commit data... | |
| fixed_array_benchmark.cc | Loading commit data... | |
| fixed_array_exception_safety_test.cc | Loading commit data... | |
| fixed_array_test.cc | Loading commit data... | |
| flat_hash_map.h | Loading commit data... | |
| flat_hash_map_test.cc | Loading commit data... | |
| flat_hash_set.h | Loading commit data... | |
| flat_hash_set_test.cc | Loading commit data... | |
| inlined_vector.h | Loading commit data... | |
| inlined_vector_benchmark.cc | Loading commit data... | |
| inlined_vector_exception_safety_test.cc | Loading commit data... | |
| inlined_vector_test.cc | Loading commit data... | |
| node_hash_map.h | Loading commit data... | |
| node_hash_map_test.cc | Loading commit data... | |
| node_hash_set.h | Loading commit data... | |
| node_hash_set_test.cc | Loading commit data... | |
| sample_element_size_test.cc | Loading commit data... |