commit 05d593e017074f43c732e781d9bb6492b8f6e9e9
parent 106993a18fb56b974ffdf6a34b233eebf78dc2f3
Author: vaplv <vaplv@free.fr>
Date: Tue, 27 Oct 2020 14:40:48 +0100
Fix the "early stop" in the hash table clear function
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/hash_table.h b/src/hash_table.h
@@ -233,7 +233,7 @@ HTABLE_FUNC__(pair_copy_and_release__)
struct HTABLE__ {
struct HTABLE_DATA__ table;
struct darray_char table_slot_is_used;
- size_t table_size_in_use;
+ size_t table_size_in_use; /* #slots in used */
struct mem_allocator* allocator;
};
@@ -307,6 +307,7 @@ HTABLE_FUNC__(clear)(struct HTABLE__* htbl)
* subsequent uses */
HTABLE_FUNC__(pair_release__)(pair);
HTABLE_FUNC__(pair_init__)(htbl->allocator, pair);
+ ++in_use;
}
htbl->table_size_in_use = 0;
}