From e8e7715bebdd401ebacfabb66928d0f7e4733120 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 13 Oct 2017 13:19:15 -0400 Subject: [PATCH] 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) --- src/libstd/collections/hash/table.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index 527c4ef4592c..7e623a0af17c 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -1156,6 +1156,7 @@ impl Clone for RawTable { } new_ht.size = self.size(); + new_ht.set_tag(self.tag()); new_ht }