From a8cc0b5eae3caafaeb03746cbf1d511705a6586b Mon Sep 17 00:00:00 2001 From: Pavel Charvat Date: Sun, 7 Nov 2010 19:41:03 +0100 Subject: [PATCH] hashtable: Bugfix. --- ucw/hashtable.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ucw/hashtable.h b/ucw/hashtable.h index 96c41afa..622f071a 100644 --- a/ucw/hashtable.h +++ b/ucw/hashtable.h @@ -655,8 +655,9 @@ static int HASH_PREFIX(delete)(TAC HASH_KEY_DECL) { *bb = b->next; P(free)(TTC b); + T.hash_count--; #ifndef HASH_TABLE_GROWING - if (--T.hash_count < T.hash_min) + if (T.hash_count < T.hash_min) P(rehash)(TTC T.hash_size/2); #endif return 1; @@ -686,8 +687,9 @@ static void HASH_PREFIX(remove)(TAC HASH_NODE *n) ASSERT(b); *bb = b->next; P(free)(TTC b); + T.hash_count--; #ifndef HASH_TABLE_GROWING - if (--T.hash_count < T.hash_min) + if (T.hash_count < T.hash_min) P(rehash)(TTC T.hash_size/2); #endif } -- 2.39.2