From df37df639f0c28e7cb155172576e7a14cdca8ed6 Mon Sep 17 00:00:00 2001 From: Mosder Date: Fri, 10 Jul 2026 17:07:47 +0200 Subject: refactor: simplified NULL initalization in hashmap to memset --- analyzer/utils/structures/hashmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/analyzer/utils/structures/hashmap.c b/analyzer/utils/structures/hashmap.c index 466f258..bab6572 100644 --- a/analyzer/utils/structures/hashmap.c +++ b/analyzer/utils/structures/hashmap.c @@ -9,8 +9,8 @@ HashMap *hashmap_new( void (*value_cleanup)(void *key) ) { HashMap *map = malloc(sizeof(HashMap)); - for (size_t i = 0; i < HASHMAP_TABLE_SIZE; i++) - map->table[i] = NULL; + // initialize NULLs + memset(map->table, 0, sizeof(HashMapNode *) * HASHMAP_TABLE_SIZE); map->key_size = key_size; map->value_size = value_size; map->hash = hash; -- cgit v1.2.3