summary refs log tree commit diff stats
path: root/compiler/nimsets.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2019-05-08 17:18:46 +0200
committerGitHub <noreply@github.com>2019-05-08 17:18:46 +0200
commit61380d0a070a4a691e820e18b25e9dd8fb420306 (patch)
treea786b6ba0f9e831fecfb75de2a5c3d097a24a962 /compiler/nimsets.nim
parent8180d443b9938f135dd280bcd5e1727766cd7468 (diff)
parentcc28eef38e601171644ffe1a2775744eaaca8123 (diff)
downloadNim-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/nimsets.nim')
-rw-r--r--compiler/nimsets.nim10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/nimsets.nim b/compiler/nimsets.nim
index b00353e20..b13f3be3d 100644
--- a/compiler/nimsets.nim
+++ b/compiler/nimsets.nim
@@ -18,7 +18,7 @@ proc inSet*(s: PNode, elem: PNode): bool =
   if s.kind != nkCurly:
     #internalError(s.info, "inSet")
     return false
-  for i in countup(0, sonsLen(s) - 1):
+  for i in 0 ..< sonsLen(s):
     if s.sons[i].kind == nkRange:
       if leValue(s.sons[i].sons[0], elem) and
           leValue(elem, s.sons[i].sons[1]):
@@ -48,7 +48,7 @@ proc someInSet*(s: PNode, a, b: PNode): bool =
   if s.kind != nkCurly:
     #internalError(s.info, "SomeInSet")
     return false
-  for i in countup(0, sonsLen(s) - 1):
+  for i in 0 ..< sonsLen(s):
     if s.sons[i].kind == nkRange:
       if leValue(s.sons[i].sons[0], b) and leValue(b, s.sons[i].sons[1]) or
           leValue(s.sons[i].sons[0], a) and leValue(a, s.sons[i].sons[1]):
@@ -63,7 +63,7 @@ proc toBitSet*(conf: ConfigRef; s: PNode, b: var TBitSet) =
   var first, j: BiggestInt
   first = firstOrd(conf, s.typ.sons[0])
   bitSetInit(b, int(getSize(conf, s.typ)))
-  for i in countup(0, sonsLen(s) - 1):
+  for i in 0 ..< sonsLen(s):
     if s.sons[i].kind == nkRange:
       j = getOrdValue(s.sons[i].sons[0])
       while j <= getOrdValue(s.sons[i].sons[1]):
@@ -133,7 +133,7 @@ proc equalSets*(conf: ConfigRef; a, b: PNode): bool =
 proc complement*(conf: ConfigRef; a: PNode): PNode =
   var x: TBitSet
   toBitSet(conf, a, x)
-  for i in countup(0, high(x)): x[i] = not x[i]
+  for i in 0 .. high(x): x[i] = not x[i]
   result = toTreeSet(conf, x, a.typ, a.info)
 
 proc deduplicate*(conf: ConfigRef; a: PNode): PNode =
@@ -150,7 +150,7 @@ proc setHasRange*(s: PNode): bool =
   assert s.kind == nkCurly
   if s.kind != nkCurly:
     return false
-  for i in countup(0, sonsLen(s) - 1):
+  for i in 0 ..< sonsLen(s):
     if s.sons[i].kind == nkRange:
       return true
   result = false