remove unnecessary if statement (#18792)

This commit is contained in:
flywind
2021-09-03 22:41:00 +08:00
committed by GitHub
parent 06ff0e9624
commit 905fae51f6

View File

@@ -434,12 +434,12 @@ proc transformYield(c: PTransf, n: PNode): PNode =
else:
# we need to introduce new local variables:
result.add(introduceNewLocalVars(c, c.transCon.forLoopBody))
if result.len > 0:
for idx in 0 ..< result.len:
var changeNode = result[idx]
changeNode.info = c.transCon.forStmt.info
for i, child in changeNode:
child.info = changeNode.info
for idx in 0 ..< result.len:
var changeNode = result[idx]
changeNode.info = c.transCon.forStmt.info
for i, child in changeNode:
child.info = changeNode.info
proc transformAddrDeref(c: PTransf, n: PNode, a, b: TNodeKind): PNode =
result = transformSons(c, n)