Skip to content

Commit b918c88

Browse files
committed
Don't shadow raw_bucket variables
1 parent 3c95c02 commit b918c88

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/map_core.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -282,18 +282,18 @@ impl<K, V> IndexMapCore<K, V> {
282282
if shifted_entries.len() > raw_capacity / 2 {
283283
// shift all indices greater than `index`
284284
unsafe {
285-
for raw_bucket in self.indices.iter() {
286-
let i = raw_bucket.read();
285+
for bucket in self.indices.iter() {
286+
let i = bucket.read();
287287
if i > index {
288-
raw_bucket.write(i - 1);
288+
bucket.write(i - 1);
289289
}
290290
}
291291
}
292292
} else {
293293
// find each following entry to shift its index
294294
for (i, entry) in (index + 1..).zip(shifted_entries) {
295-
let raw_bucket = self.find_index(entry.hash, i).unwrap();
296-
unsafe { raw_bucket.write(i - 1) };
295+
let shifted_bucket = self.find_index(entry.hash, i).unwrap();
296+
unsafe { shifted_bucket.write(i - 1) };
297297
}
298298
}
299299

@@ -336,8 +336,8 @@ impl<K, V> IndexMapCore<K, V> {
336336
// was not last element
337337
// examine new element in `index` and find it in indices
338338
let last = self.entries.len();
339-
let raw_bucket = self.find_index(entry.hash, last).unwrap();
340-
unsafe { raw_bucket.write(index) };
339+
let swapped_bucket = self.find_index(entry.hash, last).unwrap();
340+
unsafe { swapped_bucket.write(index) };
341341
}
342342

343343
(index, entry.key, entry.value)

0 commit comments

Comments
 (0)