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:
parent
bb9e850246
commit
e8e7715beb
1 changed files with 1 additions and 0 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue