diff --git a/src/common/frequency_sketch.rs b/src/common/frequency_sketch.rs index c518b167..fb334aea 100644 --- a/src/common/frequency_sketch.rs +++ b/src/common/frequency_sketch.rs @@ -120,7 +120,8 @@ impl FrequencySketch { let mut frequency = u8::MAX; for i in 0..4 { let index = self.index_of(hash, i); - let count = (self.table[index] >> ((start + i) << 2) & 0xF) as u8; + let shift = (start + i) << 2; + let count = ((self.table[index] >> shift) & 0xF) as u8; frequency = frequency.min(count); } frequency