use hashmap_new_with_allocator instead of hashmap_new in resize()

Also fix small typo where seed0 was being passed as both seed0 and
seed1 arguments to hashmap_new
pull/25/head
Arthur Pinheiro 2 years ago committed by Arthur Pinheiro
parent 5a1f68a1aa
commit 3d046197c9

@ -206,7 +206,8 @@ void hashmap_clear(struct hashmap *map, bool update_cap) {
static bool resize(struct hashmap *map, size_t new_cap) { static bool resize(struct hashmap *map, size_t new_cap) {
struct hashmap *map2 = hashmap_new(map->elsize, new_cap, map->seed1, struct hashmap *map2 = hashmap_new_with_allocator(map->malloc, map->realloc, map->free,
map->elsize, new_cap, map->seed0,
map->seed1, map->hash, map->compare, map->seed1, map->hash, map->compare,
map->elfree, map->udata); map->elfree, map->udata);
if (!map2) { if (!map2) {

Loading…
Cancel
Save