mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 06:43:52 +00:00
Use safeLen in pairs iterator for PNode (#7684)
This commit is contained in:
committed by
Andreas Rumpf
parent
b503ca03f6
commit
c461811bde
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user