std: Set probe length tag on cloned hashmaps

This isn't strictly necessary for hashmap cloning to work. The tag is
used to hint for an upcoming resize, so it's good to copy this
information over.

(We can do cleverer things like actually resizing the hashmap when we
see the tag, or even cleaning up the entry order, but this requires
more thought and might not be worth it)
This commit is contained in:
Manish Goregaokar 2017-10-13 13:19:15 -04:00
parent bb9e850246
commit e8e7715beb
No known key found for this signature in database
GPG key ID: 3BBF4D3E2EF79F98

View file

@ -1156,6 +1156,7 @@ impl<K: Clone, V: Clone> Clone for RawTable<K, V> {
}
new_ht.size = self.size();
new_ht.set_tag(self.tag());
new_ht
}