We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents bb51a84 + 810eeef commit f1e78c6Copy full SHA for f1e78c6
src/libcore/hashmap.rs
@@ -220,14 +220,17 @@ pub mod linear {
220
},
221
};
222
223
+ /* re-inserting buckets may cause changes in size, so remember what
224
+ our new size is ahead of time before we start insertions */
225
+ let size = self.size - 1;
226
idx = self.next_bucket(idx, len_buckets);
227
while self.buckets[idx].is_some() {
228
let mut bucket = None;
229
bucket <-> self.buckets[idx];
230
self.insert_opt_bucket(bucket);
231
232
}
- self.size -= 1;
233
+ self.size = size;
234
235
value
236
0 commit comments