From 8be9e4640320ddc4c11cf433fb6e232a743a9700 Mon Sep 17 00:00:00 2001 From: Araq Date: Tue, 13 Oct 2015 14:10:33 +0200 Subject: udpated the compiler and tester to use getOrDefault --- lib/pure/xmltree.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/pure/xmltree.nim') diff --git a/lib/pure/xmltree.nim b/lib/pure/xmltree.nim index 4a506546b..a9fc8998a 100644 --- a/lib/pure/xmltree.nim +++ b/lib/pure/xmltree.nim @@ -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`. -- cgit 1.4.1-2-gfad0