summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-09-03 22:41:00 +0800
committerGitHub <noreply@github.com>2021-09-03 16:41:00 +0200
commit905fae51f6ecfcde04276db669eb9a4f6481fc31 (patch)
tree36feea21cd47e1f69d9429a8dcfb376b2f92b808 /compiler
parent06ff0e96249884f4ac6c49dadc96147be1c31097 (diff)
downloadNim-905fae51f6ecfcde04276db669eb9a4f6481fc31.tar.gz
remove unnecessary if statement (#18792)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/transf.nim12
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/transf.nim b/compiler/transf.nim
index 80794b581..3250f2ec4 100644
--- a/compiler/transf.nim
+++ b/compiler/transf.nim
@@ -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)