Remove the need for unwrap when using ProbeSeq#208
Merged
bors merged 4 commits intorust-lang:masterfrom Oct 15, 2020
Merged
Conversation
Amanieu
reviewed
Oct 14, 2020
| #[inline] | ||
| fn next(&mut self) -> Option<usize> { | ||
| impl ProbeSeq { | ||
| fn move_next(&mut self, bucket_mask: usize) { |
Member
There was a problem hiding this comment.
Why did you change this to pass the bucket mask as an argument?
Member
There was a problem hiding this comment.
Also this method needs #[inline].
Contributor
Author
There was a problem hiding this comment.
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; |
Member
There was a problem hiding this comment.
Just use probe_seq.pos directly in the code below.
added 2 commits
October 14, 2020 12:39
Member
|
@bors r+ |
Contributor
|
📌 Commit cbcd654 has been approved by |
Contributor
Contributor
|
☀️ Test successful - checks-travis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.