From c8bb2371ebf25ab78abde84e3c5742f9844a74b7 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 23 Jul 2015 23:11:08 +0200 Subject: Optimize empty sets This reduces the number of Bindings allocations by about 10%. --- src/libexpr/eval.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libexpr/eval.hh') diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index 1b546f89c836..80eba975e9c3 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); -- cgit 1.4.1