Skip to content

Commit

Permalink
clones inside the loop
Browse files Browse the repository at this point in the history
  • Loading branch information
behzadnouri committed Dec 19, 2024
1 parent c9139d9 commit 1a04286
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion perf/src/deduper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ impl<const K: usize, T: ?Sized + Hash> Deduper<K, T> {
#[allow(clippy::arithmetic_side_effects)]
pub fn dedup(&self, data: &T) -> bool {
let mut out = true;
for mut hasher in self.hashers.iter().map(AHasher::clone) {
for hasher in &self.hashers {
let mut hasher = hasher.clone();
data.hash(&mut hasher);
let hash: u64 = hasher.finish() % self.num_bits;
let index = (hash >> 6) as usize;
Expand Down

0 comments on commit 1a04286

Please sign in to comment.