From ab80f200e8b5e9bc03c31164d4f4425a34943ddb Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Sun, 20 Mar 2022 14:15:24 +0000 Subject: [PATCH] Encaspulate a bit better --- agb/src/hash_map.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agb/src/hash_map.rs b/agb/src/hash_map.rs index ecec173a..2b335f62 100644 --- a/agb/src/hash_map.rs +++ b/agb/src/hash_map.rs @@ -439,7 +439,7 @@ impl Node { impl Drop for Node { fn drop(&mut self) { - if self.distance_to_initial_bucket >= 0 { + if self.has_value() { unsafe { ptr::drop_in_place(self.key.as_mut_ptr()) }; unsafe { ptr::drop_in_place(self.value.as_mut_ptr()) }; }