From f18b3af9d4a6393ba988cdb17d8f0861b1c75c7d Mon Sep 17 00:00:00 2001 From: Clyybber Date: Tue, 7 May 2019 12:04:00 +0200 Subject: Replace countup(x, y-1) with x ..< y --- compiler/ccgstmts.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'compiler/ccgstmts.nim') diff --git a/compiler/ccgstmts.nim b/compiler/ccgstmts.nim index 2f8e1653f..7d0367938 100644 --- a/compiler/ccgstmts.nim +++ b/compiler/ccgstmts.nim @@ -779,7 +779,7 @@ proc genCaseStringBranch(p: BProc, b: PNode, e: TLoc, labl: TLabel, proc genStringCase(p: BProc, t: PNode, d: var TLoc) = # count how many constant strings there are in the case: var strings = 0 - for i in countup(1, sonsLen(t) - 1): + for i in 1 ..< sonsLen(t): if t.sons[i].kind == nkOfBranch: inc(strings, sonsLen(t.sons[i]) - 1) if strings > stringCaseThreshold: var bitMask = math.nextPowerOfTwo(strings) - 1 @@ -788,7 +788,7 @@ proc genStringCase(p: BProc, t: PNode, d: var TLoc) = var a: TLoc initLocExpr(p, t.sons[0], a) # fist pass: gnerate ifs+goto: var labId = p.labels - for i in countup(1, sonsLen(t) - 1): + for i in 1 ..< sonsLen(t): inc(p.labels) if t.sons[i].kind == nkOfBranch: genCaseStringBranch(p, t.sons[i], a, "LA" & rope(p.labels) & "_", -- cgit 1.4.1-2-gfad0