From 82d852df041653c8abc38d9e27a578bf0a42fbb4 Mon Sep 17 00:00:00 2001 From: lqs Date: Fri, 9 Jan 2026 11:39:35 +0800 Subject: [PATCH] Modifiy the check condition of same hash bucket in hashmap_set --- hashmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hashmap.c b/hashmap.c index 86df8f4..4fdb1b6 100644 --- a/hashmap.c +++ b/hashmap.c @@ -295,7 +295,7 @@ const void *hashmap_set_with_hash(struct hashmap *map, const void *item, return NULL; } bitem = bucket_item(bucket); - if (entry->hash == bucket->hash && (!map->compare || + if (entry->dib == bucket->dib && (!map->compare || map->compare(eitem, bitem, map->udata) == 0)) { memcpy(map->spare, bitem, map->elsize);