diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-07-19 13:04:33 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-07-19 13:04:33 -0700 |
commit | 5f9d1d22af102a8e9d2a769ea02243fb5763fe74 (patch) | |
tree | ef40e8f9509a29e1a23afc4f681dfb9296c57880 /hash.c | |
parent | 53fb3e6b09dbe62d66c516870855ba448f56c4b0 (diff) | |
download | txr-5f9d1d22af102a8e9d2a769ea02243fb5763fe74.tar.gz txr-5f9d1d22af102a8e9d2a769ea02243fb5763fe74.tar.bz2 txr-5f9d1d22af102a8e9d2a769ea02243fb5763fe74.zip |
* hash.c (hash_construct): Nullify the pairs argument so that
it works correctly with an empty vector.
* txr.1: Write missing documentation for hash-construct.
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -812,6 +812,8 @@ val hash_construct(val hashv_args, val pairs) { val hash = hashv(hashv_args); + pairs = nullify(pairs); + for (; pairs; pairs = cdr(pairs)) { val pair = car(pairs); sethash(hash, first(pair), second(pair)); |