From: Pavel Charvat Date: Sun, 7 Nov 2010 18:41:03 +0000 (+0100) Subject: hashtable: Bugfix. X-Git-Tag: v5.0~131 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=a8cc0b5eae3caafaeb03746cbf1d511705a6586b;p=libucw.git hashtable: Bugfix. --- 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 }