diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-10-21 19:33:13 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-10-21 19:33:13 -0700 |
commit | 84e9903c27ede099e2361e15b16a05c6aa4dc819 (patch) | |
tree | bfa7c782a6f4e7ba3003c813b310f51e9d6bd9b9 /hash.c | |
parent | d438a09df2bb086fd159835de87b166474a8643b (diff) | |
download | txr-84e9903c27ede099e2361e15b16a05c6aa4dc819.tar.gz txr-84e9903c27ede099e2361e15b16a05c6aa4dc819.tar.bz2 txr-84e9903c27ede099e2361e15b16a05c6aa4dc819.zip |
hash: observe count in eql-based hash.
* hash.c (eql_hash): Decrement count and bail if zero.
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -283,6 +283,9 @@ ucnum equal_hash(val obj, int *count, ucnum seed) static ucnum eql_hash(val obj, int *count) { + if ((*count)-- <= 0) + return 0; + switch (tag(obj)) { case TAG_PTR: switch (type(obj)) { |