mirror of
https://github.com/greg7mdp/parallel-hashmap.git
synced 2026-08-30 00:50:38 +08:00
Make begin() to return end() on empty tables. (#297)
Eliminate performance overhead in constructing begin() iterators on empty hash tables.
This commit is contained in:
Vendored
+1
@@ -1245,6 +1245,7 @@ public:
|
||||
~raw_hash_set() { destroy_slots(); }
|
||||
|
||||
iterator begin() {
|
||||
if (empty()) return end();
|
||||
auto it = iterator_at(0);
|
||||
it.skip_empty_or_deleted();
|
||||
return it;
|
||||
|
||||
Reference in New Issue
Block a user