summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-11-22 18:13:01 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-11-29 23:57:56 +0100
commitf564e5f4a62fb8ca54695c722c7e04803df869ec (patch)
treea1ae2e3a9c0167a637efbe8e2a79c017709359bf
parente6fdb474b7fc4237b19d8405074930518ac02b27 (diff)
libihash: fix fast insertion corner case
* libihash/ihash.c (hurd_ihash_locp_add): Fix insertion if the key doesn't match.
-rw-r--r--libihash/ihash.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libihash/ihash.c b/libihash/ihash.c
index 8b1ad1f8..598d3412 100644
--- a/libihash/ihash.c
+++ b/libihash/ihash.c
@@ -267,6 +267,7 @@ hurd_ihash_locp_add (hurd_ihash_t ht, hurd_ihash_locp_t locp,
if (ht->size == 0
|| item == NULL
|| item->value == _HURD_IHASH_DELETED
+ || ! compare (ht, item->key, key)
|| hurd_ihash_get_load (ht) > ht->max_load)
return hurd_ihash_add (ht, key, value);