diff options
author | Ori Bernstein <ori@eigenstate.org> | 2018-08-11 22:35:08 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2018-08-11 22:48:45 -0700 |
commit | 2cd9927f90410e345fab398fe2573fe6971ef3b0 (patch) | |
tree | 236fc7402f5299b1655841a62ec45d84713897af /mi | |
parent | 92847c0604e5f4fa790b1783595e8a503ad271be (diff) | |
download | mc-2cd9927f90410e345fab398fe2573fe6971ef3b0.tar.gz |
We don't need early breaks.
Diffstat (limited to 'mi')
-rw-r--r-- | mi/match.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -248,14 +248,11 @@ acceptall(Dtree *t, Dtree *accept) if (t->accept || t->any == accept) return 0; - ret = 0; - if (t->any) { - if (acceptall(t->any, accept)) - ret = 1; - } else { + ret = 1; + if (t->any) + ret = acceptall(t->any, accept); + else t->any = accept; - ret = 1; - } for (i = 0; i < t->nnext; i++) if (acceptall(t->next[i], accept)) @@ -320,8 +317,6 @@ addwildrec(Srcloc loc, Type *ty, Dtree *start, Dtree *accept, Dtree ***end, size lfree(&last, &nlast); last = tail; nlast = ntail; - if (i == ty->nsub - 1) - break; } break; case Tyarray: @@ -338,8 +333,6 @@ addwildrec(Srcloc loc, Type *ty, Dtree *start, Dtree *accept, Dtree ***end, size lfree(&last, &nlast); last = tail; nlast = ntail; - if (i == nelt - 1) - break; } break; case Tystruct: @@ -354,8 +347,6 @@ addwildrec(Srcloc loc, Type *ty, Dtree *start, Dtree *accept, Dtree ***end, size lfree(&last, &nlast); last = tail; nlast = ntail; - if (i == ty->nsub - 1) - break; } break; case Tyunion: |