Skip to content

Commit a58b4e9

Browse files
committed
Adjustment to how htable lookup by position works
1 parent 9be148b commit a58b4e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ds/ds_htable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static inline void ds_htable_auto_truncate(ds_htable_t *table)
129129
{
130130
const uint32_t capacity = table->capacity;
131131

132-
if (table->size <= capacity / 4 && capacity > DS_HTABLE_MIN_CAPACITY) {
132+
if (table->size < (capacity / 4) && (capacity / 2) >= DS_HTABLE_MIN_CAPACITY) {
133133
ds_htable_pack(table);
134134
ds_htable_realloc(table, capacity / 2);
135135
ds_htable_rehash(table);

0 commit comments

Comments
 (0)