Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8154:f15ce57d84d1 HEAD
hash2: minor code cleanup.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 05 Sep 2008 12:40:28 +0300 |
parents | 30fedb49296e |
children | b8feb139cf92 |
files | src/lib/hash2.c |
diffstat | 1 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/hash2.c Fri Sep 05 12:40:01 2008 +0300 +++ b/src/lib/hash2.c Fri Sep 05 12:40:28 2008 +0300 @@ -185,8 +185,7 @@ } 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 @@ 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 @@ 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 @@ 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; }