Skip to content

Commit

Permalink
Adjustment to how htable lookup by position works
Browse files Browse the repository at this point in the history
  • Loading branch information
rtheunissen committed Jul 19, 2017
1 parent 9be148b commit a58b4e9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ds/ds_htable.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ static inline void ds_htable_auto_truncate(ds_htable_t *table)
{
const uint32_t capacity = table->capacity;

if (table->size <= capacity / 4 && capacity > DS_HTABLE_MIN_CAPACITY) {
if (table->size < (capacity / 4) && (capacity / 2) >= DS_HTABLE_MIN_CAPACITY) {
ds_htable_pack(table);
ds_htable_realloc(table, capacity / 2);
ds_htable_rehash(table);
Expand Down

0 comments on commit a58b4e9

Please sign in to comment.