diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-05-08 17:18:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-08 17:18:46 +0200 |
commit | 61380d0a070a4a691e820e18b25e9dd8fb420306 (patch) | |
tree | a786b6ba0f9e831fecfb75de2a5c3d097a24a962 /compiler/canonicalizer.nim | |
parent | 8180d443b9938f135dd280bcd5e1727766cd7468 (diff) | |
parent | cc28eef38e601171644ffe1a2775744eaaca8123 (diff) | |
download | Nim-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/canonicalizer.nim')
-rw-r--r-- | compiler/canonicalizer.nim | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/canonicalizer.nim b/compiler/canonicalizer.nim index 2b6096298..8c418b790 100644 --- a/compiler/canonicalizer.nim +++ b/compiler/canonicalizer.nim @@ -120,7 +120,7 @@ proc hashType(c: var MD5Context, t: PType) = case t.kind of tyGenericBody, tyGenericInst, tyGenericInvocation: - for i in countup(0, sonsLen(t) -1 -ord(t.kind != tyGenericInvocation)): + for i in 0 ..< sonsLen(t)-ord(t.kind != tyGenericInvocation): c.hashType t.sons[i] of tyUserTypeClass: internalAssert t.sym != nil and t.sym.owner != nil @@ -128,7 +128,7 @@ proc hashType(c: var MD5Context, t: PType) = of tyUserTypeClassInst: let body = t.base c.hashSym body.sym - for i in countup(1, sonsLen(t) - 2): + for i in 1 .. sonsLen(t) - 2: c.hashType t.sons[i] of tyFromExpr: c.hashTree(t.n) @@ -138,14 +138,14 @@ proc hashType(c: var MD5Context, t: PType) = of tyTuple: if t.n != nil: assert(sonsLen(t.n) == sonsLen(t)) - for i in countup(0, sonsLen(t.n) - 1): + for i in 0 ..< sonsLen(t.n): assert(t.n.sons[i].kind == nkSym) c &= t.n.sons[i].sym.name.s c &= ":" c.hashType(t.sons[i]) c &= "," else: - for i in countup(0, sonsLen(t) - 1): c.hashType t.sons[i] + for i in 0 ..< sonsLen(t): c.hashType t.sons[i] of tyRange: c.hashTree(t.n) c.hashType(t.sons[0]) @@ -238,7 +238,7 @@ proc encodeNode(w: PRodWriter, fInfo: TLineInfo, n: PNode, encodeVInt(n.sym.id, result) pushSym(w, n.sym) else: - for i in countup(0, sonsLen(n) - 1): + for i in 0 ..< sonsLen(n): encodeNode(w, n.info, n.sons[i], result) add(result, ')') @@ -304,7 +304,7 @@ proc encodeType(w: PRodWriter, t: PType, result: var string) = add(result, '=') encodeVInt(t.align, result) encodeLoc(w, t.loc, result) - for i in countup(0, sonsLen(t) - 1): + for i in 0 ..< sonsLen(t): if t.sons[i] == nil: add(result, "^()") else: |