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
+1
View File
@@ -1156,6 +1156,7 @@ fn clone(&self) -> RawTable<K, V> {
}
new_ht.size = self.size();
new_ht.set_tag(self.tag());
new_ht
}