summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-10-21 19:33:13 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-10-21 19:33:13 -0700
commit84e9903c27ede099e2361e15b16a05c6aa4dc819 (patch)
treebfa7c782a6f4e7ba3003c813b310f51e9d6bd9b9 /hash.c
parentd438a09df2bb086fd159835de87b166474a8643b (diff)
downloadtxr-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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 39173a15..f06fea61 100644
--- a/hash.c
+++ b/hash.c
@@ -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)) {