diff options
author | Abseil Team <absl-team@google.com> | 2021-05-06 07:35:26 -0700 |
---|---|---|
committer | Andy Getz <durandal@google.com> | 2021-05-06 11:11:13 -0400 |
commit | 70b29fe5a5c1752158830eabc9aa273718b477af (patch) | |
tree | 1b610f6f1e53b8814f949b94c6f7ae8694af9419 /absl/container/internal | |
parent | 037ade20d1132781aae3cda4d547a9e6a5f557bf (diff) |
Export of internal Abseil changes
--
daf5a2b9ab3507ad5fb9aebe9165933f33098b83 by Abseil Team <absl-team@google.com>:
Absl flat containers reserve enough space even in the presence of tombstones.
PiperOrigin-RevId: 372339945
--
9a61504867ba0eccc5046d7333090fbe3439cdd9 by Abseil Team <absl-team@google.com>:
Add benchmark for BlockingCounter
PiperOrigin-RevId: 372246068
--
91ee87e6de09fc62970667ee52654c9dcf7c478d by Evan Brown <ezb@google.com>:
In absl::StrSplit, support btree_multimap, and other non-std::multimap-multimaps by supporting any map type that returns iterator from insert().
Also:
- Use emplace() instead of insert() when available, not just for std::(multi)map - we can potentially change some string copies to moves this way.
- We no longer need the Insert class so remove it.
PiperOrigin-RevId: 372209653
GitOrigin-RevId: daf5a2b9ab3507ad5fb9aebe9165933f33098b83
Change-Id: I83098fde4a722cd4b682f024d3bfa56c613f960c
Diffstat (limited to 'absl/container/internal')
-rw-r--r-- | absl/container/internal/raw_hash_set.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/absl/container/internal/raw_hash_set.h b/absl/container/internal/raw_hash_set.h index 8615de8b..b23e0078 100644 --- a/absl/container/internal/raw_hash_set.h +++ b/absl/container/internal/raw_hash_set.h @@ -1323,8 +1323,8 @@ class raw_hash_set { } void reserve(size_t n) { - size_t m = GrowthToLowerboundCapacity(n); - if (m > capacity_) { + if (n > size() + growth_left()) { + size_t m = GrowthToLowerboundCapacity(n); resize(NormalizeCapacity(m)); } } |