summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-07-06 21:17:26 -0700
committerOri Bernstein <ori@eigenstate.org>2017-07-06 21:19:53 -0700
commit9fac732aba4712fb34231a429c9ce5db921c0564 (patch)
tree6acd16924cc89613e4abcb079e9aca3180496990
parentc677bdf1701a7207c8756a673c8795408a18a7da (diff)
downloadmc-9fac732aba4712fb34231a429c9ce5db921c0564.tar.gz
Cleaner/correcter version of the termination condition.
It isn't entirely equivalent, but the cases where it returns true should be the same. And it shouldn't return false early.
-rw-r--r--parse/type.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse/type.c b/parse/type.c
index c5cdda0..ca927ca 100644
--- a/parse/type.c
+++ b/parse/type.c
@@ -727,8 +727,8 @@ int tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search)
if (a->tid == b->tid)
return 1;
- if (bshas(avisited, a->tid) || bshas(bvisited, b->tid))
- return bshas(avisited, a->tid) == bshas(bvisited, b->tid);
+ if (bshas(avisited, a->tid) && bshas(bvisited, b->tid))
+ return 1;
bsput(avisited, a->tid);
bsput(bvisited, b->tid);