Skip to content

Commit

Permalink
Now dispatching find method
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaCappelletti94 committed Aug 26, 2024
1 parent 2700501 commit 07381a1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/composite_hash/gaps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,29 @@ where
"The index ({index}) must be less than 2^({})",
Self::Precision::EXPONENT,
);
if hash_bits == 8
&& core::any::TypeId::of::<<CH as PrefixFreeCode<8>>::Code>()
== core::any::TypeId::of::<NoPrefixCode<8>>()
|| hash_bits == 16
&& core::any::TypeId::of::<<CH as PrefixFreeCode<16>>::Code>()
== core::any::TypeId::of::<NoPrefixCode<16>>()
|| hash_bits == 24
&& core::any::TypeId::of::<<CH as PrefixFreeCode<24>>::Code>()
== core::any::TypeId::of::<NoPrefixCode<24>>()
|| hash_bits == 32
&& core::any::TypeId::of::<<CH as PrefixFreeCode<32>>::Code>()
== core::any::TypeId::of::<NoPrefixCode<32>>()
{
return CH::find(
hashes,
number_of_hashes,
index,
register,
original_hash,
hash_bits,
);
}

let encoded_hash = Self::encode(index, register, original_hash, hash_bits);
Self::downgraded(hashes, number_of_hashes, hash_bits, 0)
.position(|hash| hash == encoded_hash)
Expand Down

0 comments on commit 07381a1

Please sign in to comment.