mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 00:47:28 +01:00
Clear iterate slice-variables after iteration
This commit is contained in:
1 parent
92cda94f66
commit
c9221e7c27
2 files changed
+26
No files matched your search
@@ -480,6 +480,10 @@ func (g *gen) writeStatementIterate(b *buffer, n *a.Iterate, depth uint32) error
|
||||
unroll = 1
|
||||
}
|
||||
}
|
||||
for _, o := range assigns {
|
||||
name := o.AsAssign().LHS().Ident().Str(g.tm)
|
||||
b.printf("%s%s.len = 0;\n", vPrefix, name)
|
||||
}
|
||||
|
||||
b.writes("}\n")
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user