Skip to content

Commit 63aa152

Browse files
bors[bot]Amanieu
andcommitted
Merge #33
33: More bug fixes r=Amanieu a=Amanieu Co-authored-by: Amanieu d'Antras <amanieu@gmail.com>
2 parents b1e9c27 + dc131b1 commit 63aa152

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/raw/generic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ impl Group {
122122
/// - `FULL => DELETED`
123123
#[inline]
124124
pub fn convert_special_to_empty_and_full_to_deleted(&self) -> Group {
125-
let special = self.0 & repeat(0x80);
126-
Group(special + (!special >> 7))
125+
let full = !self.0 & repeat(0x80);
126+
Group(!full + (full >> 7))
127127
}
128128
}

src/raw/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,9 @@ impl<T> RawTable<T> {
554554
// size. If both the new and old position fall within the
555555
// same unaligned group, then there is no benefit in moving
556556
// it and we can just continue to the next item.
557-
let probe_index = |pos| {
558-
((pos - guard.probe_seq(hash).offset) & guard.bucket_mask) / Group::WIDTH
557+
let probe_index = |pos: usize| {
558+
(pos.wrapping_sub(guard.probe_seq(hash).offset) & guard.bucket_mask)
559+
/ Group::WIDTH
559560
};
560561
if likely(probe_index(i) == probe_index(new_i)) {
561562
guard.set_ctrl(i, h2(hash));

0 commit comments

Comments
 (0)