Skip to content

Commit 9e82153

Browse files
committed
Tweak search loop
1 parent 070fd02 commit 9e82153

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/raw/mod.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -939,30 +939,25 @@ impl<T, A: Allocator + Clone> RawTable<T, A> {
939939
) -> Result<Bucket<T>, R> {
940940
let h2_hash = h2(hash);
941941
let mut probe_seq = self.table.probe_seq(hash);
942-
let mut group = Group::load(self.table.ctrl(probe_seq.pos));
943-
let mut bitmask = group.match_byte(h2_hash).into_iter();
944942

945943
loop {
946-
if let Some(bit) = bitmask.next() {
944+
let group = Group::load(self.table.ctrl(probe_seq.pos));
945+
946+
for bit in group.match_byte(h2_hash).into_iter() {
947947
let index = (probe_seq.pos + bit) & self.table.bucket_mask;
948948

949949
let bucket = self.bucket(index);
950950
let elm = self.bucket(index).as_ref();
951951
if likely(eq(elm)) {
952952
return Ok(bucket);
953953
}
954-
955-
// Look at the next bit
956-
continue;
957954
}
958955

959956
if let Some(stop) = stop(&group, &probe_seq) {
960957
return Err(stop);
961958
}
962959

963960
probe_seq.move_next(self.table.bucket_mask);
964-
group = Group::load(self.table.ctrl(probe_seq.pos));
965-
bitmask = group.match_byte(h2_hash).into_iter();
966961
}
967962
}
968963

0 commit comments

Comments
 (0)