From 7be18b4a80ea1a52bb6d9d01d158d3eada9ca40e Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 5 Nov 2021 17:36:00 +0000 Subject: [PATCH] Be more correct with `MapIndex` usage --- src/ptr_map.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ptr_map.cpp b/src/ptr_map.cpp index 7937e6968..ac74dcfbc 100644 --- a/src/ptr_map.cpp +++ b/src/ptr_map.cpp @@ -168,7 +168,7 @@ void map_rehash(PtrMap *h, isize new_count) { template V *map_get(PtrMap *h, K key) { - isize index = map__find(h, key).entry_index; + MapIndex index = map__find(h, key).entry_index; if (index != MAP_SENTINEL) { return &h->entries.data[index].value; } @@ -177,7 +177,7 @@ V *map_get(PtrMap *h, K key) { template V &map_must_get(PtrMap *h, K key) { - isize index = map__find(h, key).entry_index; + MapIndex index = map__find(h, key).entry_index; GB_ASSERT(index != MAP_SENTINEL); return h->entries.data[index].value; } @@ -251,7 +251,7 @@ gb_inline void map_clear(PtrMap *h) { #if PTR_MAP_ENABLE_MULTI_MAP template PtrMapEntry *multi_map_find_first(PtrMap *h, K key) { - isize i = map__find(h, key).entry_index; + MapIndex i = map__find(h, key).entry_index; if (i == MAP_SENTINEL) { return nullptr; } @@ -260,7 +260,7 @@ PtrMapEntry *multi_map_find_first(PtrMap *h, K key) { template PtrMapEntry *multi_map_find_next(PtrMap *h, PtrMapEntry *e) { - isize i = e->next; + MapIndex i = e->next; while (i != MAP_SENTINEL) { if (h->entries.data[i].key == e->key) { return &h->entries.data[i];