mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Fix the len() method on LinearMap during popping
This commit is contained in:
parent
fc9650b146
commit
810eeef444
@ -220,6 +220,9 @@ pub mod linear {
|
||||
},
|
||||
};
|
||||
|
||||
/* re-inserting buckets may cause changes in size, so remember what
|
||||
our new size is ahead of time before we start insertions */
|
||||
let size = self.size - 1;
|
||||
idx = self.next_bucket(idx, len_buckets);
|
||||
while self.buckets[idx].is_some() {
|
||||
let mut bucket = None;
|
||||
@ -227,7 +230,7 @@ pub mod linear {
|
||||
self.insert_opt_bucket(bucket);
|
||||
idx = self.next_bucket(idx, len_buckets);
|
||||
}
|
||||
self.size -= 1;
|
||||
self.size = size;
|
||||
|
||||
value
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user