Skip to content

Commit f9fefdc

Browse files
committed
khash null keys hackery
1 parent 6de40bd commit f9fefdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

khash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static const double __ac_HASH_UPPER = 0.77;
175175
SCOPE khint_t kh_put_##name(kh_##name##_t *h, khkey_t key, int *ret) \
176176
{ \
177177
khint_t x; \
178-
if (h->n_occupied >= h->upper_bound) { /* update the hash table */ \
178+
if (!h->keys || !h->flags || h->n_occupied >= h->upper_bound) { /* update the hash table */ \
179179
if (h->n_buckets > (h->size<<1)) { \
180180
kh_resize_##name(h, h->n_buckets - 1); /* clear "deleted" elements */ \
181181
} else { \

0 commit comments

Comments
 (0)