From 7e747d11c66405f08cc7c69e5afc18348663275e Mon Sep 17 00:00:00 2001 From: Clyybber Date: Thu, 28 Nov 2019 17:13:04 +0100 Subject: Cosmetic compiler cleanup (#12718) * Cleanup compiler code base * Unify add calls * Unify len invocations * Unify range operators * Fix oversight * Remove {.procvar.} pragma * initCandidate -> newCandidate where reasonable * Unify safeLen calls --- compiler/sighashes.nim | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'compiler/sighashes.nim') diff --git a/compiler/sighashes.nim b/compiler/sighashes.nim index 90b7001a5..f94cd5bce 100644 --- a/compiler/sighashes.nim +++ b/compiler/sighashes.nim @@ -84,7 +84,7 @@ proc hashTree(c: var MD5Context, n: PNode) = of nkStrLit..nkTripleStrLit: c &= n.strVal else: - for i in 0.. 0 and t.sons[0] != nil: - hashType c, t.sons[0], flags + if t.len > 0 and t[0] != nil: + hashType c, t[0], flags of tyRef, tyPtr, tyGenericBody, tyVar: c &= char(t.kind) c.hashType t.lastSon, flags @@ -180,24 +180,24 @@ proc hashType(c: var MD5Context, t: PType; flags: set[ConsiderFlag]) = of tyTuple: c &= char(t.kind) if t.n != nil and CoType notin flags: - assert(len(t.n) == len(t)) - for i in 0 ..< len(t.n): - assert(t.n.sons[i].kind == nkSym) - c &= t.n.sons[i].sym.name.s + assert(t.n.len == t.len) + for i in 0..