about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorShaun Steenkamp <theguywholikeslinux@gmail.com>2018-02-13 16:32:35 +0000
committerShaun Steenkamp <theguywholikeslinux@gmail.com>2018-02-13 16:32:35 +0000
commita295ec1ec9d7616474a620a8acd15944aaf0c638 (patch)
tree91f1e5568c536da18665f0706eebd8518c9ef193 /src/libstd
parentfd78621717e4f9f73b41256627bfe3a83aa5e660 (diff)
downloadrust-a295ec1ec9d7616474a620a8acd15944aaf0c638.tar.gz
rust-a295ec1ec9d7616474a620a8acd15944aaf0c638.zip
38880 restore original entry(key) method
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/collections/hash/map.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs
index c4f3fdc283e..23a932c7aa3 100644
--- a/src/libstd/collections/hash/map.rs
+++ b/src/libstd/collections/hash/map.rs
@@ -1031,7 +1031,9 @@ impl<K, V, S> HashMap<K, V, S>
     pub fn entry(&mut self, key: K) -> Entry<K, V> {
         // Gotta resize now.
         self.reserve(1);
-        self.search_mut(&key).into_entry(key).expect("unreachable")
+        let hash = self.make_hash(&key);
+        search_hashed(&mut self.table, hash, |q| q.eq(&key))
+            .into_entry(key).expect("unreachable")
     }
 
     /// Returns the number of elements in the map.