Skip to content

Commit

Permalink
Small improvement in RawTableInner::rehash_in_place function
Browse files Browse the repository at this point in the history
  • Loading branch information
JustForFun88 committed Sep 7, 2022
1 parent 22c7dbc commit 5f059ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/raw/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,6 @@ impl<A: Allocator + Clone> RawTableInner<A> {

// Search for a suitable place to put it
let new_i = guard.find_insert_slot(hash);
let new_i_p = guard.bucket_ptr(new_i, size_of);

// Probing works by scanning through all of the control
// bytes in groups, which may not be aligned to the group
Expand All @@ -1519,6 +1518,8 @@ impl<A: Allocator + Clone> RawTableInner<A> {
continue 'outer;
}

let new_i_p = guard.bucket_ptr(new_i, size_of);

// We are moving the current item to a new position. Write
// our H2 to the control byte of the new position.
let prev_ctrl = guard.replace_ctrl_h2(new_i, hash);
Expand Down

0 comments on commit 5f059ce

Please sign in to comment.