summary refs log tree commit diff stats
path: root/compiler/vm.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-05-08 17:18:46 +0200
committerGitHub <noreply@github.com>2019-05-08 17:18:46 +0200
commit61380d0a070a4a691e820e18b25e9dd8fb420306 (patch)
treea786b6ba0f9e831fecfb75de2a5c3d097a24a962 /compiler/vm.nim
parent8180d443b9938f135dd280bcd5e1727766cd7468 (diff)
parentcc28eef38e601171644ffe1a2775744eaaca8123 (diff)
downloadNim-61380d0a070a4a691e820e18b25e9dd8fb420306.tar.gz
Small cleanup (#11185)
* Remove mStaticTy and mTypeTy

* Replace countup(x, y-1) with x ..< y

* Replace countup(x, y) with x .. y
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r--compiler/vm.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim
index d8694d721..6fc2626f7 100644
--- a/compiler/vm.nim
+++ b/compiler/vm.nim
@@ -200,7 +200,7 @@ proc copyValue(src: PNode): PNode =
   of nkStrLit..nkTripleStrLit: result.strVal = src.strVal
   else:
     newSeq(result.sons, sonsLen(src))
-    for i in countup(0, sonsLen(src) - 1):
+    for i in 0 ..< sonsLen(src):
       result.sons[i] = copyValue(src.sons[i])
 
 proc asgnComplex(x: var TFullReg, y: TFullReg) =
@@ -778,7 +778,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
       addSon(b, regs[rb].regToNode)
       var r = diffSets(c.config, regs[ra].node, b)
       discardSons(regs[ra].node)
-      for i in countup(0, sonsLen(r) - 1): addSon(regs[ra].node, r.sons[i])
+      for i in 0 ..< sonsLen(r): addSon(regs[ra].node, r.sons[i])
     of opcCard:
       decodeB(rkInt)
       regs[ra].intVal = nimsets.cardSet(c.config, regs[rb].node)
@@ -1154,7 +1154,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
       # we know the next instruction is a 'fjmp':
       let branch = c.constants[instr.regBx-wordExcess]
       var cond = false
-      for j in countup(0, sonsLen(branch) - 2):
+      for j in 0 .. sonsLen(branch) - 2:
         if overlap(regs[ra].regToNode, branch.sons[j]):
           cond = true
           break
@@ -1756,7 +1756,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
     of opcNDel:
       decodeBC(rkNode)
       let bb = regs[rb].intVal.int
-      for i in countup(0, regs[rc].intVal.int-1):
+      for i in 0 ..< regs[rc].intVal.int:
         delSon(regs[ra].node, bb)
     of opcGenSym:
       decodeBC(rkNode)