udpated the compiler and tester to use getOrDefault

This commit is contained in:
Araq 2015-10-13 14:10:33 +02:00
commit 8be9e46403
19 changed files with 82 additions and 59 deletions

View file

@ -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`.