diff options
| author | gingerBill <bill@gingerbill.org> | 2018-02-03 10:32:47 +0000 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-02-03 10:32:47 +0000 |
| commit | 0134c387596eb3d892b8ae6b467f802dbed80555 (patch) | |
| tree | ce8a26975bf205aeebc2a9e2066829885583180e /core/_preload.odin | |
| parent | d07909551739a4487420204f12021e78944e6dbb (diff) | |
Fix issue #181
Diffstat (limited to 'core/_preload.odin')
| -rw-r--r-- | core/_preload.odin | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/core/_preload.odin b/core/_preload.odin index 7d39172db..a1c4183c3 100644 --- a/core/_preload.odin +++ b/core/_preload.odin @@ -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; } - 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); last := __dynamic_map_find(h, __dynamic_map_get_entry(h, fr.entry_index).key); if last.entry_prev >= 0 { @@ -1302,4 +1299,8 @@ __dynamic_map_erase :: proc(using h: __Map_Header, fr: __Map_Find_Result) { } else { m.hashes[last.hash_index] = fr.entry_index; } + + if fr.entry_index == m.entries.len-1 { + m.entries.len -= 1; + } } |