mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
Fix issue #181
This commit is contained in:
+4
-3
@@ -1292,9 +1292,6 @@ __dynamic_map_erase :: proc(using h: __Map_Header, fr: __Map_Find_Result) {
|
|||||||
__dynamic_map_get_entry(h, fr.entry_prev).next = __dynamic_map_get_entry(h, fr.entry_index).next;
|
__dynamic_map_get_entry(h, fr.entry_prev).next = __dynamic_map_get_entry(h, fr.entry_index).next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if fr.entry_index == m.entries.len-1 {
|
|
||||||
m.entries.len -= 1;
|
|
||||||
}
|
|
||||||
__mem_copy(__dynamic_map_get_entry(h, fr.entry_index), __dynamic_map_get_entry(h, m.entries.len-1), entry_size);
|
__mem_copy(__dynamic_map_get_entry(h, fr.entry_index), __dynamic_map_get_entry(h, m.entries.len-1), entry_size);
|
||||||
last := __dynamic_map_find(h, __dynamic_map_get_entry(h, fr.entry_index).key);
|
last := __dynamic_map_find(h, __dynamic_map_get_entry(h, fr.entry_index).key);
|
||||||
if last.entry_prev >= 0 {
|
if last.entry_prev >= 0 {
|
||||||
@@ -1302,4 +1299,8 @@ __dynamic_map_erase :: proc(using h: __Map_Header, fr: __Map_Find_Result) {
|
|||||||
} else {
|
} else {
|
||||||
m.hashes[last.hash_index] = fr.entry_index;
|
m.hashes[last.hash_index] = fr.entry_index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if fr.entry_index == m.entries.len-1 {
|
||||||
|
m.entries.len -= 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user