Merge pull request #25 from arthurep/fix_resize_new_hashmap

use hashmap_new_with_allocator instead of hashmap_new in resize()
pull/26/head v0.6.1
Josh Baker 2 years ago committed by GitHub
commit 603792ba74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -206,9 +206,10 @@ void hashmap_clear(struct hashmap *map, bool update_cap) {
static bool resize(struct hashmap *map, size_t new_cap) {
struct hashmap *map2 = hashmap_new(map->elsize, new_cap, map->seed1,
map->seed1, map->hash, map->compare,
map->elfree, map->udata);
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->elfree, map->udata);
if (!map2) {
return false;
}

Loading…
Cancel
Save