diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | hash.c | 6 |
2 files changed, 9 insertions, 3 deletions
@@ -1,5 +1,11 @@ 2014-02-14 Kaz Kylheku <kaz@kylheku.com> + * hash.c (inhash): Rename local variable from new to new_p. + This is consistent with usage elsewhere in the module, + and more importantly, keeps our code C++. + +2014-02-14 Kaz Kylheku <kaz@kylheku.com> + * lib.c (class_check): Bugfix: the function was assuming that the argument is a pointer type object, leading to a crash if given a fixnum integer or string literal. @@ -552,11 +552,11 @@ val inhash(val hash, val key, val init) found = h->assoc_fun(key, chain); } else { val *pchain = vecref_l(h->table, num_fast(h->hash_fun(key) % h->modulus)); - val old = *pchain, new; - val *place = h->acons_new_l_fun(key, &new, pchain); + val old = *pchain, new_p; + val *place = h->acons_new_l_fun(key, &new_p, pchain); if (old != *pchain && ++h->count > 2 * h->modulus) hash_grow(h); - if (new) + if (new_p) *place = init; found = h->assoc_fun(key, *pchain); } |