diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-01-29 14:08:07 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-01-29 14:08:07 -0800 |
commit | 3dc7aa2ef572a26f9c5e0ea134b43c80a013e8f5 (patch) | |
tree | ba497af2f84050dfa253b6860e26854150544496 /hash.h | |
parent | 06a0dd484bc93a02bd3cf4ff77d2b99474c84c4e (diff) | |
download | txr-3dc7aa2ef572a26f9c5e0ea134b43c80a013e8f5.tar.gz txr-3dc7aa2ef572a26f9c5e0ea134b43c80a013e8f5.tar.bz2 txr-3dc7aa2ef572a26f9c5e0ea134b43c80a013e8f5.zip |
Simplify gethash variants using new function.
* hash.c (gethash_e): New function. Just returns the entry cell if
found, or else nil. This should have been written first.
(gethash, gethash_f, gethash_n): Replace body with trivial one-liner
based on gethash_e.
* hash.h (gethash_e): Declared.
Diffstat (limited to 'hash.h')
-rw-r--r-- | hash.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -32,6 +32,7 @@ val make_hash(val weak_keys, val weak_vals, val equal_based); val make_similar_hash(val existing); val copy_hash(val existing); val gethash_c(val hash, val key, loc new_p); +val gethash_e(val hash, val key); val gethash(val hash, val key); val inhash(val hash, val key, val init); val gethash_n(val hash, val key, val notfound_val); |