diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | hash.c | 6 |
2 files changed, 8 insertions, 2 deletions
@@ -1,5 +1,9 @@ 2014-02-14 Kaz Kylheku <kaz@kylheku.com> + * hash.c (hash_update): Avoid double cdr. + +2014-02-14 Kaz Kylheku <kaz@kylheku.com> + * hash.c (inhash): Simplify with gethash_c. 2014-02-14 Kaz Kylheku <kaz@kylheku.com> @@ -1008,8 +1008,10 @@ val hash_update(val hash, val fun) { val iter = hash_begin(hash); val cell; - while ((cell = hash_next(iter)) != nil) - rplacd(cell, funcall1(fun, cdr(cell))); + while ((cell = hash_next(iter)) != nil) { + val *loc = cdr_l(cell); + set(*loc, funcall1(fun, *loc)); + } return hash; } |