From b918c88cdcb34d1e719c230852834e8f084398d4 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 25 Jun 2020 12:06:03 -0700 Subject: [PATCH] Don't shadow raw_bucket variables --- src/map_core.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/map_core.rs b/src/map_core.rs index 98232d38..2024af09 100644 --- a/src/map_core.rs +++ b/src/map_core.rs @@ -282,18 +282,18 @@ impl IndexMapCore { if shifted_entries.len() > raw_capacity / 2 { // shift all indices greater than `index` unsafe { - for raw_bucket in self.indices.iter() { - let i = raw_bucket.read(); + for bucket in self.indices.iter() { + let i = bucket.read(); if i > index { - raw_bucket.write(i - 1); + bucket.write(i - 1); } } } } else { // find each following entry to shift its index for (i, entry) in (index + 1..).zip(shifted_entries) { - let raw_bucket = self.find_index(entry.hash, i).unwrap(); - unsafe { raw_bucket.write(i - 1) }; + let shifted_bucket = self.find_index(entry.hash, i).unwrap(); + unsafe { shifted_bucket.write(i - 1) }; } } @@ -336,8 +336,8 @@ impl IndexMapCore { // was not last element // examine new element in `index` and find it in indices let last = self.entries.len(); - let raw_bucket = self.find_index(entry.hash, last).unwrap(); - unsafe { raw_bucket.write(index) }; + let swapped_bucket = self.find_index(entry.hash, last).unwrap(); + unsafe { swapped_bucket.write(index) }; } (index, entry.key, entry.value)