mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 00:47:28 +01:00
cgen: simplify 1-elem in-case-of-recursion arrays
This commit is contained in:
1 parent
df1d4f64e2
commit
2c2bb9baa5
6 files changed
+1025
-1034
No files matched your search
@@ -66,8 +66,7 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, sideEffectsOnly bool, depth u
|
||||
|
||||
} else if ident == t.IDCoroutineResumed {
|
||||
if g.currFunk.astFunc.Effect().Coroutine() {
|
||||
// TODO: don't hard-code [0], and allow recursive coroutines.
|
||||
b.printf("(self->private_impl.%s%s[0] != 0)",
|
||||
b.printf("(self->private_impl.%s%s != 0)",
|
||||
pPrefix, g.currFunk.astFunc.FuncName().Str(g.tm))
|
||||
} else {
|
||||
b.writes("false")
|
||||
|
||||
Reference in new issue
Block a user