summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2024-04-01 12:55:37 +0200
committerUros Majstorovic <majstor@majstor.org>2024-04-01 12:55:37 +0200
commit6e2cdee6c397933d2925efdcca939ae2339bc76a (patch)
tree3c325288b8e1f5fa8ecc31dea05142037e74c631
parentdb16c435440950bae7289a41fb583b7a0749e511 (diff)
fixed hashtable remove_kv
-rwxr-xr-xecp/src/ecp/htable/hashtable.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ecp/src/ecp/htable/hashtable.c b/ecp/src/ecp/htable/hashtable.c
index 13ed68c..f6d3a0b 100755
--- a/ecp/src/ecp/htable/hashtable.c
+++ b/ecp/src/ecp/htable/hashtable.c
@@ -302,7 +302,8 @@ hashtable_remove_kv_static(struct hashtable *h, void *k, void *v)
e = *pE;
while (NULL != e)
{
- if (v == e->v)
+ /* Check hash value to short circuit heavier comparison */
+ if ((hashvalue == e->h) && (h->eqfn(k, e->k)) && (v == e->v))
{
*pE = e->next;
h->entrycount--;