summary refs log tree commit diff stats
path: root/compiler/nimsets.nim
diff options
context:
space:
mode:
authorClyybber <darkmine956@gmail.com>2019-09-09 11:54:15 +0200
committerAndreas Rumpf <rumpf_a@web.de>2019-09-09 11:54:15 +0200
commited1d41c51e5b3772fdea9e08733dbf46dfb4428e (patch)
tree48add0b4f759aad5f212894000424df82751eeaa /compiler/nimsets.nim
parentaa95ae6af93e04c5465d76347ab2150bf13d9669 (diff)
downloadNim-ed1d41c51e5b3772fdea9e08733dbf46dfb4428e.tar.gz
Small ast.nim cleanup (#12156)
* Remove sonsLen
* Use Indexable
Diffstat (limited to 'compiler/nimsets.nim')
-rw-r--r--compiler/nimsets.nim8
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/nimsets.nim b/compiler/nimsets.nim
index bd070f2c7..5ae7ef590 100644
--- a/compiler/nimsets.nim
+++ b/compiler/nimsets.nim
@@ -17,7 +17,7 @@ proc inSet*(s: PNode, elem: PNode): bool =
   if s.kind != nkCurly:
     #internalError(s.info, "inSet")
     return false
-  for i in 0 ..< sonsLen(s):
+  for i in 0 ..< len(s):
     if s.sons[i].kind == nkRange:
       if leValue(s.sons[i].sons[0], elem) and
           leValue(elem, s.sons[i].sons[1]):
@@ -47,7 +47,7 @@ proc someInSet*(s: PNode, a, b: PNode): bool =
   if s.kind != nkCurly:
     #internalError(s.info, "SomeInSet")
     return false
-  for i in 0 ..< sonsLen(s):
+  for i in 0 ..< len(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]):
@@ -62,7 +62,7 @@ proc toBitSet*(conf: ConfigRef; s: PNode, b: var TBitSet) =
   var first, j: Int128
   first = firstOrd(conf, s.typ.sons[0])
   bitSetInit(b, int(getSize(conf, s.typ)))
-  for i in 0 ..< sonsLen(s):
+  for i in 0 ..< len(s):
     if s.sons[i].kind == nkRange:
       j = getOrdValue(s.sons[i].sons[0], first)
       while j <= getOrdValue(s.sons[i].sons[1], first):
@@ -149,7 +149,7 @@ proc setHasRange*(s: PNode): bool =
   assert s.kind == nkCurly
   if s.kind != nkCurly:
     return false
-  for i in 0 ..< sonsLen(s):
+  for i in 0 ..< len(s):
     if s.sons[i].kind == nkRange:
       return true
   result = false