diff options
| author | Jake Koroman <jake@jakekoroman.com> | 2026-04-10 16:33:18 -0400 |
|---|---|---|
| committer | Jake Koroman <jake@jakekoroman.com> | 2026-04-10 16:33:18 -0400 |
| commit | bb625daf76502ced920b90309bbb7efdea5f4608 (patch) | |
| tree | 7e3be16e2f9def1b778b2d86feb802222e395fca /jrk.h | |
| parent | 993796ca56f3b7ab2cd3939becb12628e85a43f5 (diff) | |
fix hashmap.
Diffstat (limited to 'jrk.h')
| -rw-r--r-- | jrk.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -337,7 +337,7 @@ typedef jrk_array_realloc_function_t jrk_hm_realloc_function_t; bool jrk_hm_##fnname##_init_ex(jrk_Hash_Map_##typename*,u64,jrk_hm_alloc_function_t,void*); #define jrk_hm_impl(type, fnname, typename) \ - jrk_Hash_Map_Item_##fnname * \ + jrk_Hash_Map_Item_##typename * \ jrk_hm_##fnname##_get_spot(jrk_Hash_Map_##typename *hm, jrk_String key) \ { \ jrk_Hash_Map_Item_##typename *result = NULL; \ @@ -423,7 +423,7 @@ typedef jrk_array_realloc_function_t jrk_hm_realloc_function_t; hm->len = 0; \ hm->capacity = capacity; \ hm->items = __jrk_hm_alloc(hm, hm->capacity, sizeof(jrk_Hash_Map_Item_##typename)); \ - \ + if (!hm->items) return false; \ return true; \ } \ \ |
