Skip to content

Commit

Permalink
khash.h: use first found k_del
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Apr 12, 2014
1 parent a18f22e commit 45eccd1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/mruby/khash.h
Expand Up @@ -180,7 +180,7 @@ kh_fill_flags(uint8_t *p, uint8_t c, size_t len)
return k; \
} \
} \
else { \
else if (del_k != kh_end(h)) { \
del_k = k; \
} \
k = (k+khash_inc(h)) & khash_mask(h); \
Expand All @@ -190,15 +190,15 @@ kh_fill_flags(uint8_t *p, uint8_t c, size_t len)
h->keys[del_k] = key; \
h->ed_flags[del_k/4] &= ~__m_del[del_k%4]; \
h->size++; \
return del_k; \
return del_k; \
} \
else { \
/* put at empty */ \
h->keys[k] = key; \
h->ed_flags[k/4] &= ~__m_empty[k%4]; \
h->size++; \
h->n_occupied++; \
return k; \
return k; \
} \
} \
void kh_del_##name(mrb_state *mrb, kh_##name##_t *h, khint_t x) \
Expand Down

0 comments on commit 45eccd1

Please sign in to comment.