From 6e2cdee6c397933d2925efdcca939ae2339bc76a Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Mon, 1 Apr 2024 12:55:37 +0200 Subject: fixed hashtable remove_kv --- ecp/src/ecp/htable/hashtable.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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--; -- cgit v1.2.3