diff --git a/agb/src/hash_map.rs b/agb/src/hash_map.rs index 9a73c4a8..e338a17e 100644 --- a/agb/src/hash_map.rs +++ b/agb/src/hash_map.rs @@ -758,6 +758,10 @@ impl NodeStorage { if let Some((k, v)) = node.key_value_mut() { if !f(k, v) { self.remove_from_location(i); + + // Need to continue before adding 1 to i because remove from location could + // put the element which was next into the ith location in the nodes array, + // so we need to check if that one needs removing too. continue; } }