Skip to content

Commit

Permalink
Rollup merge of rust-lang#32668 - frewsxcv:hashmap-address-fixme, r=a…
Browse files Browse the repository at this point in the history
…lexcrichton

Address FIXMEs related to short lifetimes in `HashMap`.

None
  • Loading branch information
steveklabnik committed Apr 6, 2016
2 parents 0f7d73e + 313eb32 commit 9c59d6b
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/libstd/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,7 @@ fn robin_hood<'a, K: 'a, V: 'a>(bucket: FullBucketMut<'a, K, V>,
mut val: V)
-> &'a mut V {
let starting_index = bucket.index();
let size = {
let table = bucket.table(); // FIXME "lifetime too short".
table.size()
};
let size = bucket.table().size();
// Save the *starting point*.
let mut bucket = bucket.stash();
// There can be at most `size - dib` buckets to displace, because
Expand Down Expand Up @@ -744,10 +741,9 @@ impl<K, V, S> HashMap<K, V, S>
let h = bucket.hash();
let (b, k, v) = bucket.take();
self.insert_hashed_ordered(h, k, v);
{
let t = b.table(); // FIXME "lifetime too short".
if t.size() == 0 { break }
};
if b.table().size() == 0 {
break;
}
b.into_bucket()
}
Empty(b) => b.into_bucket()
Expand Down

0 comments on commit 9c59d6b

Please sign in to comment.