@@ -552,7 +552,7 @@ impl<K: Eq, V, L: LruList, const TYPE: char> Bucket<K, V, L, TYPE> {
552
552
/// Returns `None` if the key is not present.
553
553
#[ inline]
554
554
pub ( super ) fn search_entry < ' g , Q > (
555
- & ' g self ,
555
+ & self ,
556
556
data_block : & ' g DataBlock < K , V , BUCKET_LEN > ,
557
557
key : & Q ,
558
558
partial_hash : u8 ,
@@ -565,18 +565,18 @@ impl<K: Eq, V, L: LruList, const TYPE: char> Bucket<K, V, L, TYPE> {
565
565
return None ;
566
566
}
567
567
568
- if let Some ( ( _ , entry_ref ) ) =
568
+ if let Some ( ( entry , _ ) ) =
569
569
Self :: search_data_block ( & self . metadata , data_block, key, partial_hash)
570
570
{
571
- return Some ( entry_ref ) ;
571
+ return Some ( entry ) ;
572
572
}
573
573
574
574
let mut link_ptr = self . metadata . link . load ( Acquire , guard) ;
575
575
while let Some ( link) = link_ptr. as_ref ( ) {
576
- if let Some ( ( _ , entry_ref ) ) =
576
+ if let Some ( ( entry , _ ) ) =
577
577
Self :: search_data_block ( & link. metadata , & link. data_block , key, partial_hash)
578
578
{
579
- return Some ( entry_ref ) ;
579
+ return Some ( entry ) ;
580
580
}
581
581
link_ptr = link. metadata . link . load ( Acquire , guard) ;
582
582
}
@@ -602,7 +602,7 @@ impl<K: Eq, V, L: LruList, const TYPE: char> Bucket<K, V, L, TYPE> {
602
602
return EntryPtr :: new ( guard) ;
603
603
}
604
604
605
- if let Some ( ( index , _ ) ) =
605
+ if let Some ( ( _ , index ) ) =
606
606
Self :: search_data_block ( & self . metadata , data_block, key, partial_hash)
607
607
{
608
608
return EntryPtr {
@@ -613,7 +613,7 @@ impl<K: Eq, V, L: LruList, const TYPE: char> Bucket<K, V, L, TYPE> {
613
613
614
614
let mut current_link_ptr = self . metadata . link . load ( Acquire , guard) ;
615
615
while let Some ( link) = current_link_ptr. as_ref ( ) {
616
- if let Some ( ( index , _ ) ) =
616
+ if let Some ( ( _ , index ) ) =
617
617
Self :: search_data_block ( & link. metadata , & link. data_block , key, partial_hash)
618
618
{
619
619
return EntryPtr {
@@ -628,12 +628,14 @@ impl<K: Eq, V, L: LruList, const TYPE: char> Bucket<K, V, L, TYPE> {
628
628
}
629
629
630
630
/// Searches the supplied data block for an entry matching the key.
631
+ #[ allow( clippy:: inline_always) ]
632
+ #[ inline( always) ]
631
633
fn search_data_block < ' g , Q , const LEN : usize > (
632
- metadata : & ' g Metadata < K , V , LEN > ,
634
+ metadata : & Metadata < K , V , LEN > ,
633
635
data_block : & ' g DataBlock < K , V , LEN > ,
634
636
key : & Q ,
635
637
partial_hash : u8 ,
636
- ) -> Option < ( usize , & ' g ( K , V ) ) >
638
+ ) -> Option < ( & ' g ( K , V ) , usize ) >
637
639
where
638
640
Q : Equivalent < K > + ?Sized ,
639
641
{
@@ -657,9 +659,9 @@ impl<K: Eq, V, L: LruList, const TYPE: char> Bucket<K, V, L, TYPE> {
657
659
658
660
let mut offset = bitmap. trailing_zeros ( ) ;
659
661
while offset != u32:: BITS {
660
- let entry_ref = unsafe { & ( * data_block[ offset as usize ] . as_ptr ( ) ) } ;
661
- if key. equivalent ( & entry_ref . 0 ) {
662
- return Some ( ( offset as usize , entry_ref ) ) ;
662
+ let entry = unsafe { & ( * data_block[ offset as usize ] . as_ptr ( ) ) } ;
663
+ if key. equivalent ( & entry . 0 ) {
664
+ return Some ( ( entry , offset as usize ) ) ;
663
665
}
664
666
bitmap -= 1_u32 << offset;
665
667
offset = bitmap. trailing_zeros ( ) ;
0 commit comments