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/liftlocals.nim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'compiler/liftlocals.nim') diff --git a/compiler/liftlocals.nim b/compiler/liftlocals.nim index eed0560ab..672dca5d9 100644 --- a/compiler/liftlocals.nim +++ b/compiler/liftlocals.nim @@ -30,10 +30,10 @@ proc lookupOrAdd(c: var Ctx; s: PSym; info: TLineInfo): PNode = let field = addUniqueField(c.objType, s, c.cache) var deref = newNodeI(nkHiddenDeref, info) deref.typ = c.objType - add(deref, newSymNode(c.partialParam, info)) + deref.add(newSymNode(c.partialParam, info)) result = newNodeI(nkDotExpr, info) - add(result, deref) - add(result, newSymNode(field)) + result.add(deref) + result.add(newSymNode(field)) result.typ = field.typ proc liftLocals(n: PNode; i: int; c: var Ctx) = @@ -44,12 +44,12 @@ proc liftLocals(n: PNode; i: int; c: var Ctx) = n[i] = lookupOrAdd(c, it.sym, it.info) of procDefs, nkTypeSection: discard else: - for i in 0 ..< it.safeLen: + for i in 0..