From 4368cd39f2869fb1efb454a1260dcf0d1511eea6 Mon Sep 17 00:00:00 2001 From: greg Date: Fri, 1 Apr 2022 14:01:39 -0400 Subject: [PATCH] operator=() should preserve load_factor - issue #136 --- parallel_hashmap/phmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parallel_hashmap/phmap.h b/parallel_hashmap/phmap.h index 3b7f602..48573b9 100644 --- a/parallel_hashmap/phmap.h +++ b/parallel_hashmap/phmap.h @@ -1154,7 +1154,7 @@ public: raw_hash_set(const raw_hash_set& that, const allocator_type& a) : raw_hash_set(0, that.hash_ref(), that.eq_ref(), a) { - reserve(that.size()); + reserve(that.capacity()); // Because the table is guaranteed to be empty, we can do something faster // than a full `insert`. for (const auto& v : that) {