about summary refs log tree commit diff
path: root/src/libexpr/value-to-xml.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-04-13T12·25+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-04-13T12·25+0000
commitac1e8f40d4a5c380d68bb6f1c7cef6f1e7987c1a (patch)
treebcdb22f27c39948cdb254afd560ac198ae675f56 /src/libexpr/value-to-xml.cc
parent10e8b1fd15d59dc541c15f6da56f8baf58eb3aa3 (diff)
* Use a symbol table to represent identifiers and attribute names
  efficiently.  The symbol table ensures that there is only one copy
  of each symbol, thus allowing symbols to be compared efficiently
  using a pointer equality test.

Diffstat (limited to 'src/libexpr/value-to-xml.cc')
-rw-r--r--src/libexpr/value-to-xml.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libexpr/value-to-xml.cc b/src/libexpr/value-to-xml.cc
index c8a067aacf..0c8fc143c3 100644
--- a/src/libexpr/value-to-xml.cc
+++ b/src/libexpr/value-to-xml.cc
@@ -28,7 +28,7 @@ static void showAttrs(EvalState & state, bool strict, Bindings & attrs,
         names.insert(i->first);
     foreach (StringSet::iterator, i, names) {
         XMLOpenElement _(doc, "attr", singletonAttrs("name", *i));
-        printValueAsXML(state, strict, attrs[*i], doc, context, drvsSeen);
+        printValueAsXML(state, strict, attrs[state.symbols.create(*i)], doc, context, drvsSeen);
     }
 }
 
@@ -67,14 +67,14 @@ static void printValueAsXML(EvalState & state, bool strict, Value & v,
             if (state.isDerivation(v)) {
                 XMLAttrs xmlAttrs;
             
-                Bindings::iterator a = v.attrs->find("derivation");
+                Bindings::iterator a = v.attrs->find(state.symbols.create("derivation"));
 
                 Path drvPath;
-                a = v.attrs->find("drvPath");
+                a = v.attrs->find(state.sDrvPath);
                 if (a != v.attrs->end() && a->second.type == tString)
                     xmlAttrs["drvPath"] = drvPath = a->second.string.s;
         
-                a = v.attrs->find("outPath");
+                a = v.attrs->find(state.sOutPath);
                 if (a != v.attrs->end() && a->second.type == tString)
                     xmlAttrs["outPath"] = a->second.string.s;