ref: c75a9bf084fa0a4cda77898cac159c7801edef27
parent: b5cf804cbeb33a60bea00307c24aa361ea821530
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Jul 5 20:05:58 EDT 2017
Remove double recursion.
--- a/parse/type.c
+++ b/parse/type.c
@@ -724,6 +724,7 @@
if (a->tid == b->tid)
return 1;
+
if (bshas(visited, a->tid) || bshas(visited, b->tid))
return 1;
@@ -763,15 +764,13 @@
for (i = 0; i < a->narg; i++)
if (!tyeq_rec(a->arg[i], b->arg[i], visited, search))
return 0;
- for (i = 0; i < a->nsub; i++)
- if (!tyeq_rec(a->sub[i], b->sub[i], visited, search))
- return 0;
break;
case Tyarray:
if (arraysz(a->asize) != arraysz(b->asize))
return 0;
break;
- default: break;
+ default:
+ break;
}
for (i = 0; i < a->nsub; i++)
if (!tyeq_rec(a->sub[i], b->sub[i], visited, search))