mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix error when HashMap.remove on uninitialized HashMap (#1629)
* HashMap: test removal on uninitialized * HashMap.remove_entry_for_key: return false on unintialized * test: switch to temp_init * release note
This commit is contained in:
@@ -482,6 +482,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];
|
||||
|
||||
Reference in New Issue
Block a user