From 166fb6b006a1da425c2b4ba434047989c720cbce Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 5 Sep 2008 12:40:28 +0300 Subject: [PATCH] hash2: minor code cleanup. --HG-- branch : HEAD --- src/lib/hash2.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib/hash2.c b/src/lib/hash2.c index 67ef269056..295e1c2564 100644 --- a/src/lib/hash2.c +++ b/src/lib/hash2.c @@ -185,8 +185,7 @@ void *hash2_insert_hash(struct hash2_table *hash, unsigned int key_hash) } static void -hash2_remove_value_p(struct hash2_table *hash, struct hash2_value **valuep, - bool allow_resize) +hash2_remove_value_p(struct hash2_table *hash, struct hash2_value **valuep) { struct hash2_value *deleted_value; @@ -197,8 +196,6 @@ hash2_remove_value_p(struct hash2_table *hash, struct hash2_value **valuep, hash->deleted_values = deleted_value; hash->count--; - if (allow_resize) - hash2_resize(hash, FALSE); } void hash2_remove(struct hash2_table *hash, const void *key) @@ -211,7 +208,8 @@ void hash2_remove(struct hash2_table *hash, const void *key) while (*valuep != NULL) { if ((*valuep)->key_hash == key_hash && hash->key_compare_cb(key, (*valuep) + 1, hash->context)) { - hash2_remove_value_p(hash, valuep, TRUE); + hash2_remove_value_p(hash, valuep); + hash2_resize(hash, FALSE); return; } valuep = &(*valuep)->next; @@ -230,7 +228,7 @@ void hash2_remove_iter(struct hash2_table *hash, struct hash2_iter *iter) next = (*valuep)->next; /* don't allow resizing, otherwise iterating would break completely */ - hash2_remove_value_p(hash, valuep, FALSE); + hash2_remove_value_p(hash, valuep); iter->next_value = next; return; } -- 2.47.3