about summary refs log tree commit diff
path: root/src/libexpr/eval.hh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-10-24T19·52+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-10-24T19·52+0000
commite0b7fb8f2710ec3012afe6b9d2096f770429a389 (patch)
treee39731edd0c55ca359db03838127e4d34f6a229f /src/libexpr/eval.hh
parent2dc6d5094183edee523a48d449eab1a376e839a2 (diff)
* Keep attribute sets in sorted order to speed up attribute lookups.
* Simplify the representation of attributes in the AST.
* Change the behaviour of listToAttrs() in case of duplicate names.

Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r--src/libexpr/eval.hh6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index e1aa69dd38d2..7f801d1125fb 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -34,7 +34,7 @@ class Bindings : public BindingsBase
 {
 public:
     iterator find(const Symbol & name);
-    Attr & operator [] (const Symbol & name);
+    void sort();
 };
 
 
@@ -142,6 +142,10 @@ struct Attr
     Attr(Symbol name, Value * value, Pos * pos = &noPos)
         : name(name), value(value), pos(pos) { };
     Attr() : pos(&noPos) { };
+    bool operator < (const Attr & a) const
+    {
+        return name < a.name;
+    }
 };