diff options
| author | Mosder <xmosder12@gmail.com> | 2026-07-10 17:07:47 +0200 |
|---|---|---|
| committer | Mosder <xmosder12@gmail.com> | 2026-07-10 17:07:47 +0200 |
| commit | df37df639f0c28e7cb155172576e7a14cdca8ed6 (patch) | |
| tree | 07c189be8eb90a75b0f0ee73faf09db96ad9b641 | |
| parent | 7b313dcfe2bb98f7d0905ba34f0a356a3774b1d0 (diff) | |
refactor: simplified NULL initalization in hashmap to memset
| -rw-r--r-- | analyzer/utils/structures/hashmap.c | 4 |
1 files 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; |
