@@ -397,17 +397,6 @@ pub struct HashMap<K, V, S = RandomState> {
397
397
resize_policy : DefaultResizePolicy ,
398
398
}
399
399
400
- /// Search for a pre-hashed key when the hash map is known to be non-empty.
401
- #[ inline]
402
- fn search_hashed_nonempty < K , V , M , F > ( table : M , hash : SafeHash , is_match : F )
403
- -> InternalEntry < K , V , M >
404
- where M : Deref < Target = RawTable < K , V > > ,
405
- F : FnMut ( & K ) -> bool
406
- {
407
- // Do not check the capacity as an extra branch could slow the lookup.
408
- search_hashed_body ( table, hash, is_match)
409
- }
410
-
411
400
/// Search for a pre-hashed key.
412
401
/// If you don't already know the hash, use search or search_mut instead
413
402
#[ inline]
@@ -422,16 +411,19 @@ fn search_hashed<K, V, M, F>(table: M, hash: SafeHash, is_match: F) -> InternalE
422
411
return InternalEntry :: TableIsEmpty ;
423
412
}
424
413
425
- search_hashed_body ( table, hash, is_match)
414
+ search_hashed_nonempty ( table, hash, is_match)
426
415
}
427
416
428
- /// The body of the search_hashed[_nonempty] functions
417
+
418
+ /// Search for a pre-hashed key when the hash map is known to be non-empty.
429
419
#[ inline]
430
- fn search_hashed_body < K , V , M , F > ( table : M , hash : SafeHash , mut is_match : F )
420
+ fn search_hashed_nonempty < K , V , M , F > ( table : M , hash : SafeHash , is_match : F )
431
421
-> InternalEntry < K , V , M >
432
422
where M : Deref < Target = RawTable < K , V > > ,
433
423
F : FnMut ( & K ) -> bool
434
424
{
425
+ // Do not check the capacity as an extra branch could slow the lookup.
426
+
435
427
let size = table. size ( ) ;
436
428
let mut probe = Bucket :: new ( table, hash) ;
437
429
let mut displacement = 0 ;
0 commit comments