summaryrefslogtreecommitdiff
path: root/parse/type.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-02-28 00:11:42 -0800
committerOri Bernstein <ori@eigenstate.org>2016-02-28 00:11:42 -0800
commitcd1b25a6047e4ed9bf368811b6a4f7e3d18b88f9 (patch)
tree73225b0fe81d5f0be9bfa496e56e68db408a0646 /parse/type.c
parent5b7e3296ba57c446904ecd173ad9f3823a119851 (diff)
downloadmc-cd1b25a6047e4ed9bf368811b6a4f7e3d18b88f9.tar.gz
Don't recompute 'hasparams' over and over.
Diffstat (limited to 'parse/type.c')
-rw-r--r--parse/type.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/parse/type.c b/parse/type.c
index 804f841..4d95717 100644
--- a/parse/type.c
+++ b/parse/type.c
@@ -401,12 +401,13 @@ int hasparamsrec(Type *t, Bitset *visited)
int hasparams(Type *t)
{
Bitset *visited;
- int r;
+ if (t->hasparams)
+ return 1;
visited = mkbs();
- r = hasparamsrec(t, visited);
+ t->hasparams = hasparamsrec(t, visited);
bsfree(visited);
- return r;
+ return t->hasparams;
}
Type *tybase(Type *t)