1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-01 12:37:59 +02:00

* 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.
This commit is contained in:
Eelco Dolstra 2010-10-24 19:52:33 +00:00
parent 2dc6d50941
commit e0b7fb8f27
12 changed files with 186 additions and 148 deletions

View file

@ -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;
}
};