udpated the compiler and tester to use getOrDefault
This commit is contained in:
parent
2fda95a4d6
commit
8be9e46403
19 changed files with 82 additions and 59 deletions
|
|
@ -342,7 +342,7 @@ proc attr*(n: XmlNode, name: string): string =
|
|||
## Returns "" on failure.
|
||||
assert n.kind == xnElement
|
||||
if n.attrs == nil: return ""
|
||||
return n.attrs[name]
|
||||
return n.attrs.getOrDefault(name)
|
||||
|
||||
proc findAll*(n: XmlNode, tag: string, result: var seq[XmlNode]) =
|
||||
## Iterates over all the children of `n` returning those matching `tag`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue