mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-22 02:00:00 +03:00
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:
@@ -1156,6 +1156,7 @@ fn clone(&self) -> RawTable<K, V> {
|
||||
}
|
||||
|
||||
new_ht.size = self.size();
|
||||
new_ht.set_tag(self.tag());
|
||||
|
||||
new_ht
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user