about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-22T15·48+0100
committerVincent Ambo <tazjin@google.com>2020-05-22T15·57+0100
commitb3c9166b23aebbbfcbe65ea59e7ea18d876d45db (patch)
tree48b9e56e7bf8608e320fdc1420597f4c026bbb10 /third_party/nix/src/libexpr/eval.cc
parente24466c7951a96b35bea947e6e6854f277eda9d7 (diff)
refactor(3p/nix/libexpr): state->allocBindings -> Bindings::NewGC r/805
EvalState::allocBindings had little to do with Bindings, other than
returning them, and didn't belong in that class.
Diffstat (limited to 'third_party/nix/src/libexpr/eval.cc')
-rw-r--r--third_party/nix/src/libexpr/eval.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/third_party/nix/src/libexpr/eval.cc b/third_party/nix/src/libexpr/eval.cc
index 679d3ca996..c6804ee114 100644
--- a/third_party/nix/src/libexpr/eval.cc
+++ b/third_party/nix/src/libexpr/eval.cc
@@ -372,7 +372,7 @@ EvalState::EvalState(const Strings& _searchPath, const ref<Store>& store)
 
   clearValue(vEmptySet);
   vEmptySet.type = tAttrs;
-  vEmptySet.attrs = allocBindings(0);
+  vEmptySet.attrs = Bindings::NewGC();
 
   createBaseEnv();
 }
@@ -857,7 +857,7 @@ void ExprAttrs::eval(EvalState& state, Env& env, Value& v) {
     if (hasOverrides) {
       Value* vOverrides = v.attrs->find(overrides->first)->second.value;
       state.forceAttrs(*vOverrides);
-      Bindings* newBnds = state.allocBindings(/* capacity = */ 0);
+      Bindings* newBnds = Bindings::NewGC();
       for (auto& i : *v.attrs) {  // TODO(tazjin): copy constructor?
         newBnds->push_back(i.second);
       }