about summary refs log tree commit diff
path: root/src/libexpr/eval.hh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-23T21·11+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-07-23T21·11+0200
commitc8bb2371ebf25ab78abde84e3c5742f9844a74b7 (patch)
tree53aeea8ded7f7b21636a87414f715f897962ffcd /src/libexpr/eval.hh
parent16c9935fa9487f504b1e9c7f14d0f85ac870a62c (diff)
Optimize empty sets
This reduces the number of Bindings allocations by about 10%.
Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r--src/libexpr/eval.hh4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 1b546f89c8..80eba975e9 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -80,6 +80,8 @@ public:
        path or to environment variables. */
     bool restricted;
 
+    Value vEmptySet;
+
 private:
     SrcToStore srcToStore;
 
@@ -227,7 +229,7 @@ public:
     Bindings * allocBindings(Bindings::size_t capacity);
 
     void mkList(Value & v, unsigned int length);
-    void mkAttrs(Value & v, unsigned int expected);
+    void mkAttrs(Value & v, unsigned int capacity);
     void mkThunk_(Value & v, Expr * expr);
     void mkPos(Value & v, Pos * pos);