Skip to content

Commit 34dad1a

Browse files
committed
Update hash_sorted_map.rs
1 parent 0efe8e0 commit 34dad1a

1 file changed

Lines changed: 1 addition & 15 deletions

File tree

crates/hash-sorted-map/src/hash_sorted_map.rs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -322,27 +322,13 @@ impl<K: Hash + Eq, V, S: BuildHasher> HashSortedMap<K, V, S> {
322322
/// of `&mut self` until any reallocation (`grow`).
323323
fn find_or_insertion_slot(&mut self, hash: u64, key: &K) -> FindResult<K, V> {
324324
let tag = tag(hash);
325-
let hint = slot_hint(hash);
326325
let mut gi = self.container.group_index(hash);
327326

328327
loop {
329328
let group = &mut self.container.groups[gi];
330329

331-
// Fast path: preferred slot.
332-
let c = group.ctrl[hint];
333-
if c == CTRL_EMPTY {
334-
return FindResult::Vacant(Insertion::Empty {
335-
group: group as *mut _,
336-
slot: hint,
337-
});
338-
}
339-
if c == tag && unsafe { group.keys[hint].assume_init_ref() } == key {
340-
return FindResult::Found(group.values[hint].as_mut_ptr());
341-
}
342-
343-
// Slow path: SIMD scan group for tag match.
330+
// SIMD scan group for tag match.
344331
let mut tag_mask = group_ops::match_tag(&group.ctrl, tag);
345-
tag_mask = group_ops::clear_slot(tag_mask, hint);
346332
while let Some(i) = group_ops::next_match(&mut tag_mask) {
347333
if unsafe { group.keys[i].assume_init_ref() } == key {
348334
return FindResult::Found(group.values[i].as_mut_ptr());

0 commit comments

Comments
 (0)