From ed1d41c51e5b3772fdea9e08733dbf46dfb4428e Mon Sep 17 00:00:00 2001 From: Clyybber Date: Mon, 9 Sep 2019 11:54:15 +0200 Subject: Small ast.nim cleanup (#12156) * Remove sonsLen * Use Indexable --- compiler/nimsets.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/nimsets.nim') 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 -- cgit 1.4.1-2-gfad0