@@ -477,7 +477,7 @@ fn search_hashed_nonempty<K, V, M, F>(table: M, hash: SafeHash, mut is_match: F,
477
477
}
478
478
479
479
// If the hash doesn't match, it can't be this one..
480
- if hash == full. hash ( ) || !compare_hashes {
480
+ if !compare_hashes || hash == full. hash ( ) {
481
481
// If the key doesn't match, it can't be this one..
482
482
if is_match ( full. read ( ) . 0 ) {
483
483
return InternalEntry :: Occupied { elem : full } ;
@@ -489,7 +489,7 @@ fn search_hashed_nonempty<K, V, M, F>(table: M, hash: SafeHash, mut is_match: F,
489
489
}
490
490
}
491
491
492
- /// Search for a pre-hashed key when the hash map is known to be non-empty .
492
+ /// Same as `search_hashed_nonempty` but for mutable access .
493
493
#[ inline]
494
494
fn search_hashed_nonempty_mut < K , V , M , F > ( table : M , hash : SafeHash , mut is_match : F ,
495
495
compare_hashes : bool )
@@ -1571,10 +1571,6 @@ impl<K, V, S> HashMap<K, V, S>
1571
1571
/// so that the map now contains keys which compare equal, search may start
1572
1572
/// acting eratically, with two keys randomly masking eachother. Implementations
1573
1573
/// are free to assume this doesn't happen (within the limits of memory-safety).
1574
- ///
1575
- /// # Examples
1576
- ///
1577
- ///
1578
1574
#[ unstable( feature = "hash_raw_entry" , issue = "54043" ) ]
1579
1575
pub fn raw_entry_mut ( & mut self ) -> RawEntryBuilderMut < K , V , S > {
1580
1576
self . reserve ( 1 ) ;
@@ -1595,7 +1591,7 @@ impl<K, V, S> HashMap<K, V, S>
1595
1591
/// Unless you are in such a situation, higher-level and more foolproof APIs like
1596
1592
/// `get` should be preferred.
1597
1593
///
1598
- /// Immutable raw entries have very limited use; you might instead want `raw_entry `.
1594
+ /// Immutable raw entries have very limited use; you might instead want `raw_entry_mut `.
1599
1595
#[ unstable( feature = "hash_raw_entry" , issue = "54043" ) ]
1600
1596
pub fn raw_entry ( & self ) -> RawEntryBuilder < K , V , S > {
1601
1597
RawEntryBuilder { map : self }
0 commit comments