diff --git a/src/enc/backward_references/mod.rs b/src/enc/backward_references/mod.rs index 120c25dd..9363fa5e 100644 --- a/src/enc/backward_references/mod.rs +++ b/src/enc/backward_references/mod.rs @@ -207,7 +207,7 @@ pub fn StoreLookaheadThenStore(hasher: &mut T, size: usize, dict: pub trait BasicHashComputer { fn HashBytes(&self, data: &[u8]) -> u32; fn BUCKET_BITS(&self) -> i32; - fn USE_DICTIONARY(&self) -> i32; + fn use_dictionary(&self) -> bool; fn BUCKET_SWEEP(&self) -> i32; } pub struct BasicHasher + SliceWrapper + BasicHashComputer> { @@ -431,7 +431,7 @@ impl + SliceWrapper + BasicHashComputer> AnyHasher } } } - if dictionary.is_some() && self.buckets_.USE_DICTIONARY() != 0 && !is_match_found { + if dictionary.is_some() && self.buckets_.use_dictionary() && !is_match_found { is_match_found = SearchInStaticDictionary( dictionary.unwrap(), dictionary_hash, @@ -462,8 +462,8 @@ impl> BasicHashComputer for H2Sub { fn BUCKET_SWEEP(&self) -> i32 { 1 } - fn USE_DICTIONARY(&self) -> i32 { - 1 + fn use_dictionary(&self) -> bool { + true } } impl> SliceWrapperMut for H2Sub { @@ -496,8 +496,8 @@ impl> BasicHashComputer for H3Sub { fn BUCKET_SWEEP(&self) -> i32 { 2 } - fn USE_DICTIONARY(&self) -> i32 { - 0 + fn use_dictionary(&self) -> bool { + false } fn HashBytes(&self, data: &[u8]) -> u32 { let h: u64 = @@ -515,8 +515,8 @@ impl> BasicHashComputer for H4Sub { fn BUCKET_SWEEP(&self) -> i32 { 4 } - fn USE_DICTIONARY(&self) -> i32 { - 1 + fn use_dictionary(&self) -> bool { + true } fn HashBytes(&self, data: &[u8]) -> u32 { let h: u64 = @@ -544,8 +544,8 @@ impl> BasicHashComputer for H54Sub { fn BUCKET_SWEEP(&self) -> i32 { 4 } - fn USE_DICTIONARY(&self) -> i32 { - 0 + fn use_dictionary(&self) -> bool { + false } fn HashBytes(&self, data: &[u8]) -> u32 { let h: u64 =