diff options
Diffstat (limited to 'compiler/nimsets.nim')
-rw-r--r-- | compiler/nimsets.nim | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/nimsets.nim b/compiler/nimsets.nim index b00353e20..b13f3be3d 100644 --- a/compiler/nimsets.nim +++ b/compiler/nimsets.nim @@ -18,7 +18,7 @@ proc inSet*(s: PNode, elem: PNode): bool = if s.kind != nkCurly: #internalError(s.info, "inSet") return false - for i in countup(0, sonsLen(s) - 1): + for i in 0 ..< sonsLen(s): if s.sons[i].kind == nkRange: if leValue(s.sons[i].sons[0], elem) and leValue(elem, s.sons[i].sons[1]): @@ -48,7 +48,7 @@ proc someInSet*(s: PNode, a, b: PNode): bool = if s.kind != nkCurly: #internalError(s.info, "SomeInSet") return false - for i in countup(0, sonsLen(s) - 1): + for i in 0 ..< sonsLen(s): if s.sons[i].kind == nkRange: if leValue(s.sons[i].sons[0], b) and leValue(b, s.sons[i].sons[1]) or leValue(s.sons[i].sons[0], a) and leValue(a, s.sons[i].sons[1]): @@ -63,7 +63,7 @@ proc toBitSet*(conf: ConfigRef; s: PNode, b: var TBitSet) = var first, j: BiggestInt first = firstOrd(conf, s.typ.sons[0]) bitSetInit(b, int(getSize(conf, s.typ))) - for i in countup(0, sonsLen(s) - 1): + for i in 0 ..< sonsLen(s): if s.sons[i].kind == nkRange: j = getOrdValue(s.sons[i].sons[0]) while j <= getOrdValue(s.sons[i].sons[1]): @@ -133,7 +133,7 @@ proc equalSets*(conf: ConfigRef; a, b: PNode): bool = proc complement*(conf: ConfigRef; a: PNode): PNode = var x: TBitSet toBitSet(conf, a, x) - for i in countup(0, high(x)): x[i] = not x[i] + for i in 0 .. high(x): x[i] = not x[i] result = toTreeSet(conf, x, a.typ, a.info) proc deduplicate*(conf: ConfigRef; a: PNode): PNode = @@ -150,7 +150,7 @@ proc setHasRange*(s: PNode): bool = assert s.kind == nkCurly if s.kind != nkCurly: return false - for i in countup(0, sonsLen(s) - 1): + for i in 0 ..< sonsLen(s): if s.sons[i].kind == nkRange: return true result = false |