Skip to content

Commit

Permalink
simplify probe state
Browse files Browse the repository at this point in the history
  • Loading branch information
ibraheemdev committed Jan 15, 2025
1 parent 4246869 commit a6f4249
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/raw/probe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ pub struct Probe {
pub i: usize,
// The current length of the probe sequence.
pub len: usize,
// The current quadratic stride.
stride: usize,
}

impl Probe {
Expand All @@ -16,16 +14,14 @@ impl Probe {
Probe {
i: hash & mask,
len: 0,
stride: 0,
}
}

// Increment the probe sequence.
#[inline]
pub fn next(&mut self, mask: usize) {
self.len += 1;
self.stride += 1;
self.i = (self.i + self.stride) & mask;
self.i = (self.i + self.len) & mask;
}
}

Expand Down

0 comments on commit a6f4249

Please sign in to comment.