Skip to content

Commit a295ec1

Browse files
committed
38880 restore original entry(key) method
1 parent fd78621 commit a295ec1

File tree

1 file changed

+3
-1
lines changed
  • src/libstd/collections/hash

1 file changed

+3
-1
lines changed

src/libstd/collections/hash/map.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,9 @@ impl<K, V, S> HashMap<K, V, S>
10311031
pub fn entry(&mut self, key: K) -> Entry<K, V> {
10321032
// Gotta resize now.
10331033
self.reserve(1);
1034-
self.search_mut(&key).into_entry(key).expect("unreachable")
1034+
let hash = self.make_hash(&key);
1035+
search_hashed(&mut self.table, hash, |q| q.eq(&key))
1036+
.into_entry(key).expect("unreachable")
10351037
}
10361038

10371039
/// Returns the number of elements in the map.

0 commit comments

Comments
 (0)