diff options
author | Oscar NihlgÄrd <oscarnihlgard@gmail.com> | 2018-04-25 02:29:47 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-04-25 02:29:47 +0200 |
commit | c461811bde431f8ab566aae11116a21af2e7d50a (patch) | |
tree | 7c56bb9315d1d43343f222a414206fdb24805659 /compiler | |
parent | b503ca03f697d7364efe0bc5cf367e9e8bd12418 (diff) | |
download | Nim-c461811bde431f8ab566aae11116a21af2e7d50a.tar.gz |
Use safeLen in pairs iterator for PNode (#7684)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ast.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/ast.nim b/compiler/ast.nim index 2c8f686eb..b8202abe6 100644 --- a/compiler/ast.nim +++ b/compiler/ast.nim @@ -1622,7 +1622,7 @@ iterator items*(n: PNode): PNode = for i in 0..<n.safeLen: yield n.sons[i] iterator pairs*(n: PNode): tuple[i: int, n: PNode] = - for i in 0..<n.len: yield (i, n.sons[i]) + for i in 0..<n.safeLen: yield (i, n.sons[i]) proc isAtom*(n: PNode): bool {.inline.} = result = n.kind >= nkNone and n.kind <= nkNilLit |