From dc8589479e6232a2cdce50742cb9cfbdc259c481 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Tue, 9 May 2023 21:34:16 +0100 Subject: [PATCH] We know the location is correct here --- agb-hashmap/src/lib.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agb-hashmap/src/lib.rs b/agb-hashmap/src/lib.rs index fc899bbc..4251768e 100644 --- a/agb-hashmap/src/lib.rs +++ b/agb-hashmap/src/lib.rs @@ -399,7 +399,11 @@ where let hash = self.hash(key); if let Some(location) = self.nodes.location(key, hash) { - self.nodes.node_at_mut(location).value_mut() + Some(unsafe { + self.nodes + .node_at_unchecked_mut(location) + .value_mut_unchecked() + }) } else { None }