From 5f059ce12196e5bbdf89af40d49950814fba0523 Mon Sep 17 00:00:00 2001 From: JustForFun88 <100504524+JustForFun88@users.noreply.github.com> Date: Wed, 7 Sep 2022 13:46:15 +0500 Subject: [PATCH] Small improvement in RawTableInner::rehash_in_place function --- src/raw/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/raw/mod.rs b/src/raw/mod.rs index 211b818a5f..653e2a1da9 100644 --- a/src/raw/mod.rs +++ b/src/raw/mod.rs @@ -1507,7 +1507,6 @@ impl RawTableInner { // 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 @@ -1519,6 +1518,8 @@ impl RawTableInner { 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);