summaryrefslogtreecommitdiffstats
path: root/src/hash.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-06-30 01:55:23 -0400
committerDavid Robillard <d@drobilla.net>2021-06-30 01:55:23 -0400
commit85903d04bd8a99b5a2c749c2c2bc103f87b35281 (patch)
tree05876ec7266b66159783f2891b5a57cf9b907abe /src/hash.c
parent10a26115c115fa1bd88b1f431f965b348c9b5cdc (diff)
downloadzix-85903d04bd8a99b5a2c749c2c2bc103f87b35281.tar.gz
zix-85903d04bd8a99b5a2c749c2c2bc103f87b35281.tar.bz2
zix-85903d04bd8a99b5a2c749c2c2bc103f87b35281.zip
Fix hash size after removing elements
Diffstat (limited to 'src/hash.c')
-rw-r--r--src/hash.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hash.c b/src/hash.c
index 8183082..d9556ed 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -200,6 +200,7 @@ zix_hash_remove(ZixHash* hash, const void* value)
if (h_nomod == e->hash && hash->equal_func(zix_hash_value(e), value)) {
*next_ptr = e->next;
free(e);
+ --hash->count;
return ZIX_STATUS_SUCCESS;
}
next_ptr = &e->next;
@@ -214,7 +215,6 @@ zix_hash_remove(ZixHash* hash, const void* value)
}
}
- --hash->count;
return ZIX_STATUS_NOT_FOUND;
}