Skip to content
This repository was archived by the owner on Jul 14, 2019. It is now read-only.

Commit dd86672

Browse files
author
Lior Amram
committed
hashtable: fix infinite loop
1 parent 97e768c commit dd86672

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/hashtable.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,11 +244,10 @@ uint32_t hashtable_lookup_insert(struct hashtable *ht, const void *key, size_t k
244244
union hashtable_internal_rec *rec = _HASHTABLE_REC(e->rec);
245245
if (rec->rec.key_size == key_len && 0 == memcmp(key, rec->rec.data, key_len))
246246
return e->rec;
247-
} else {
248-
++bucket;
249-
if (bucket > mask)
250-
bucket = 0;
251247
}
248+
++bucket;
249+
if (bucket > mask)
250+
bucket = 0;
252251
}
253252
return 0;
254253
}

0 commit comments

Comments
 (0)