diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-10-24T19·52+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-10-24T19·52+0000 |
commit | e0b7fb8f2710ec3012afe6b9d2096f770429a389 (patch) | |
tree | e39731edd0c55ca359db03838127e4d34f6a229f /src/libexpr/eval.hh | |
parent | 2dc6d5094183edee523a48d449eab1a376e839a2 (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.hh | 6 |
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; + } }; |