mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 08:11:33 +11:00
Put the capacity check back in
This commit is contained in:
parent
903157325f
commit
9ec0836da9
|
@ -339,6 +339,10 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn insert_new_and_get(&mut self, key: K, value: V, hash: HashType) -> &'_ mut V {
|
unsafe fn insert_new_and_get(&mut self, key: K, value: V, hash: HashType) -> &'_ mut V {
|
||||||
|
if self.nodes.capacity() <= self.len() {
|
||||||
|
self.resize(self.nodes.backing_vec_size() * 2);
|
||||||
|
}
|
||||||
|
|
||||||
let location = self.nodes.insert_new(key, value, hash);
|
let location = self.nodes.insert_new(key, value, hash);
|
||||||
|
|
||||||
// SAFETY: location is always valid
|
// SAFETY: location is always valid
|
||||||
|
|
Loading…
Reference in a new issue