diff --git a/lib/std/collections/map.c3 b/lib/std/collections/map.c3 index fbb753131..9afa62e53 100644 --- a/lib/std/collections/map.c3 +++ b/lib/std/collections/map.c3 @@ -369,6 +369,7 @@ fn void HashMap.free_internal(&map, void* ptr) @inline @private fn bool HashMap.remove_entry_for_key(&map, Key key) @private { + if (!map.count) return false; uint hash = rehash(key.hash()); uint i = index_for(hash, map.table.len); Entry* prev = map.table[i]; @@ -421,4 +422,4 @@ struct Entry Key key; Value value; Entry* next; -} \ No newline at end of file +}