-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the need for unwrap when using ProbeSeq #208
Conversation
#[inline] | ||
fn next(&mut self) -> Option<usize> { | ||
impl ProbeSeq { | ||
fn move_next(&mut self, bucket_mask: usize) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change this to pass the bucket mask as an argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this method needs #[inline]
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ProbeSeq never changes it so it duplicates data already found in the table. Figured it was only there since Iterator::next
couldn't take an argument.
src/raw/mod.rs
Outdated
for pos in self.probe_seq(hash) { | ||
let mut probe_seq = self.probe_seq(hash); | ||
loop { | ||
let pos = probe_seq.pos; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use probe_seq.pos
directly in the code below.
@bors r+ |
📌 Commit cbcd654 has been approved by |
☀️ Test successful - checks-travis |
Changes the order of operation here a bit so that the code only moves to the next position if it is actually necessary which could be faster, or at least makes for less work for LLVM.