aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/value-to-xml.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-10-09 15:51:52 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-10-09 16:06:29 +0200
commit99b73fb5071db9fd757c9927fc3fde34e2abac63 (patch)
treefb50f681aced9f566da52aaf22eb4275471d010a /src/libexpr/value-to-xml.cc
parente6e61f0a54dac0174df996e93fcfedcac7769ab4 (diff)
OCD performance fix: {find,count}+insert => insert
Diffstat (limited to 'src/libexpr/value-to-xml.cc')
-rw-r--r--src/libexpr/value-to-xml.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libexpr/value-to-xml.cc b/src/libexpr/value-to-xml.cc
index 00b1918a8..1f0b1541d 100644
--- a/src/libexpr/value-to-xml.cc
+++ b/src/libexpr/value-to-xml.cc
@@ -105,10 +105,9 @@ static void printValueAsXML(EvalState & state, bool strict, bool location,
XMLOpenElement _(doc, "derivation", xmlAttrs);
- if (drvPath != "" && drvsSeen.find(drvPath) == drvsSeen.end()) {
- drvsSeen.insert(drvPath);
+ if (drvPath != "" && drvsSeen.insert(drvPath).second)
showAttrs(state, strict, location, *v.attrs, doc, context, drvsSeen);
- } else
+ else
doc.writeEmptyElement("repeated");
}