Do nothing when calling clear() on empty hash_map. Cereal does call map.clear() when deserializing. Issue #19.

This commit is contained in:
greg
2019-07-27 15:11:58 -04:00
parent 1aeeff1b65
commit 20bcc22b70
3 changed files with 85 additions and 0 deletions
+2
View File
@@ -1202,6 +1202,8 @@ public:
// compared to destruction of the elements of the container. So we pick the
// largest bucket_count() threshold for which iteration is still fast and
// past that we simply deallocate the array.
if (empty())
return;
if (capacity_ > 127) {
destroy_slots();
} else if (capacity_) {