summary refs log tree commit diff stats
path: root/compiler/passes.nim
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2019-05-07 12:04:00 +0200
committerClyybber <darkmine956@gmail.com>2019-05-07 12:32:05 +0200
commitf18b3af9d4a6393ba988cdb17d8f0861b1c75c7d (patch)
tree8d4fe109101792fb0f7bdfb33c0a0071d34e6f71 /compiler/passes.nim
parent9ffab44c35cb31c1811800e130e4dc1bd59503f9 (diff)
downloadNim-f18b3af9d4a6393ba988cdb17d8f0861b1c75c7d.tar.gz
Replace countup(x, y-1) with x ..< y
Diffstat (limited to 'compiler/passes.nim')
-rw-r--r--compiler/passes.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/passes.nim b/compiler/passes.nim
index fb51b3f73..7c6acd936 100644
--- a/compiler/passes.nim
+++ b/compiler/passes.nim
@@ -67,21 +67,21 @@ proc carryPasses*(g: ModuleGraph; nodes: PNode, module: PSym;
 
 proc openPasses(g: ModuleGraph; a: var TPassContextArray;
                 module: PSym) =
-  for i in countup(0, g.passes.len - 1):
+  for i in 0 ..< g.passes.len:
     if not isNil(g.passes[i].open):
       a[i] = g.passes[i].open(g, module)
     else: a[i] = nil
 
 proc closePasses(graph: ModuleGraph; a: var TPassContextArray) =
   var m: PNode = nil
-  for i in countup(0, graph.passes.len - 1):
+  for i in 0 ..< graph.passes.len:
     if not isNil(graph.passes[i].close): m = graph.passes[i].close(graph, a[i], m)
     a[i] = nil                # free the memory here
 
 proc processTopLevelStmt(graph: ModuleGraph, n: PNode, a: var TPassContextArray): bool =
   # this implements the code transformation pipeline
   var m = n
-  for i in countup(0, graph.passes.len - 1):
+  for i in 0 ..< graph.passes.len:
     if not isNil(graph.passes[i].process):
       m = graph.passes[i].process(a[i], m)
       if isNil(m): return false