}
}
- fn pop(&mut self, k: &K) -> Option<V> {
- let hash = k.hash_keyed(self.k0, self.k1) as uint;
- self.pop_internal(hash, k)
- }
-
- fn swap(&mut self, k: K, v: V) -> Option<V> {
- // this could be faster.
- let hash = k.hash_keyed(self.k0, self.k1) as uint;
- let old_value = self.pop_internal(hash, &k);
-
- if self.size >= self.resize_at {
- // n.b.: We could also do this after searching, so
- // that we do not resize if this call to insert is
- // simply going to update a key in place. My sense
- // though is that it's worse to have to search through
- // buckets to find the right spot twice than to just
- // resize in this corner case.
- self.expand();
- }
-
- self.insert_internal(hash, k, v);
-
- old_value
- }
-
/// Return the value corresponding to the key in the map, or insert
/// and return the value if it doesn't exist.
+ #[cfg(stage0)]
fn find_or_insert<'a>(&'a mut self, k: K, v: V) -> &'a V {
if self.size >= self.resize_at {
// n.b.: We could also do this after searching, so