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

This commit is contained in:
Clyybber 2019-05-07 12:04:00 +02:00
commit f18b3af9d4
58 changed files with 312 additions and 312 deletions

View file

@ -157,7 +157,7 @@ proc presentFailedCandidates(c: PContext, n: PNode, errors: CandidateErrors):
for err in errors:
var errProto = ""
let n = err.sym.typ.n
for i in countup(1, n.len - 1):
for i in 1 ..< n.len:
var p = n.sons[i]
if p.kind == nkSym:
add(errProto, typeToString(p.sym.typ, preferName))
@ -396,7 +396,7 @@ proc resolveOverloads(c: PContext, n, orig: PNode,
elif c.config.errorCounter == 0:
# don't cascade errors
var args = "("
for i in countup(1, sonsLen(n) - 1):
for i in 1 ..< sonsLen(n):
if i > 1: add(args, ", ")
add(args, typeToString(n.sons[i].typ))
add(args, ")")
@ -613,7 +613,7 @@ proc explicitGenericInstantiation(c: PContext, n: PNode, s: PSym): PNode =
# XXX I think this could be improved by reusing sigmatch.paramTypesMatch.
# It's good enough for now.
result = newNodeI(a.kind, getCallLineInfo(n))
for i in countup(0, len(a)-1):
for i in 0 ..< len(a):
var candidate = a.sons[i].sym
if candidate.kind in {skProc, skMethod, skConverter,
skFunc, skIterator}: