diff options
author | Clyybber <darkmine956@gmail.com> | 2019-05-07 12:04:00 +0200 |
---|---|---|
committer | Clyybber <darkmine956@gmail.com> | 2019-05-07 12:32:05 +0200 |
commit | f18b3af9d4a6393ba988cdb17d8f0861b1c75c7d (patch) | |
tree | 8d4fe109101792fb0f7bdfb33c0a0071d34e6f71 /compiler/ccgstmts.nim | |
parent | 9ffab44c35cb31c1811800e130e4dc1bd59503f9 (diff) | |
download | Nim-f18b3af9d4a6393ba988cdb17d8f0861b1c75c7d.tar.gz |
Replace countup(x, y-1) with x ..< y
Diffstat (limited to 'compiler/ccgstmts.nim')
-rw-r--r-- | compiler/ccgstmts.nim | 4 |
1 files changed, 2 insertions, 2 deletions
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) & "_", |