mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-23 16:21:33 +11:00
Simplify get_mut implementation
This commit is contained in:
parent
917163f88b
commit
9205ba1d0d
|
@ -401,15 +401,12 @@ where
|
|||
{
|
||||
let hash = self.hash(key);
|
||||
|
||||
if let Some(location) = self.nodes.location(key, hash) {
|
||||
let location = self.nodes.location(key, hash)?;
|
||||
Some(unsafe {
|
||||
self.nodes
|
||||
.node_at_unchecked_mut(location)
|
||||
.value_mut_unchecked()
|
||||
})
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
/// Removes the given key from the map. Returns the current value if it existed, or [`None`]
|
||||
|
|
Loading…
Reference in a new issue