Skip to content

Commit

Permalink
Fix clippy::unnecessary_min_or_max
Browse files Browse the repository at this point in the history
(cherry picked from commit 19db541)
  • Loading branch information
GnomedDev authored and tatsuya6502 committed Sep 8, 2024
1 parent 4c7181c commit 7a4df31
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/common/frequency_sketch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#[derive(Default)]
pub(crate) struct FrequencySketch {
sample_size: u32,
table_mask: u64,
table_mask: u32,
table: Box<[u64]>,
size: u32,
}
Expand Down Expand Up @@ -101,7 +101,7 @@ impl FrequencySketch {
}

self.table = vec![0; table_size as usize].into_boxed_slice();
self.table_mask = 0.max(table_size - 1) as u64;
self.table_mask = table_size - 1;
self.sample_size = if cap == 0 {
10
} else {
Expand Down Expand Up @@ -181,7 +181,7 @@ impl FrequencySketch {
let i = depth as usize;
let mut hash = hash.wrapping_add(SEED[i]).wrapping_mul(SEED[i]);
hash = hash.wrapping_add(hash >> 32);
(hash & self.table_mask) as usize
(hash & (self.table_mask as u64)) as usize
}
}

Expand Down

0 comments on commit 7a4df31

Please sign in to comment.