diff options
Diffstat (limited to 'compiler/treetab.nim')
-rw-r--r-- | compiler/treetab.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/treetab.nim b/compiler/treetab.nim index f15974f61..7d654509c 100644 --- a/compiler/treetab.nim +++ b/compiler/treetab.nim @@ -31,7 +31,7 @@ proc hashTree(n: PNode): Hash = of nkStrLit..nkTripleStrLit: result = result !& hash(n.strVal) else: - for i in countup(0, sonsLen(n) - 1): + for i in 0 ..< sonsLen(n): result = result !& hashTree(n.sons[i]) proc treesEquivalent(a, b: PNode): bool = @@ -47,7 +47,7 @@ proc treesEquivalent(a, b: PNode): bool = of nkStrLit..nkTripleStrLit: result = a.strVal == b.strVal else: if sonsLen(a) == sonsLen(b): - for i in countup(0, sonsLen(a) - 1): + for i in 0 ..< sonsLen(a): if not treesEquivalent(a.sons[i], b.sons[i]): return result = true if result: result = sameTypeOrNil(a.typ, b.typ) @@ -84,7 +84,7 @@ proc nodeTablePut*(t: var TNodeTable, key: PNode, val: int) = else: if mustRehash(len(t.data), t.counter): newSeq(n, len(t.data) * GrowthFactor) - for i in countup(0, high(t.data)): + for i in 0 .. high(t.data): if t.data[i].key != nil: nodeTableRawInsert(n, t.data[i].h, t.data[i].key, t.data[i].val) swap(t.data, n) @@ -101,7 +101,7 @@ proc nodeTableTestOrSet*(t: var TNodeTable, key: PNode, val: int): int = else: if mustRehash(len(t.data), t.counter): newSeq(n, len(t.data) * GrowthFactor) - for i in countup(0, high(t.data)): + for i in 0 .. high(t.data): if t.data[i].key != nil: nodeTableRawInsert(n, t.data[i].h, t.data[i].key, t.data[i].val) swap(t.data, n) |