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-22T02·35+0100
committerVincent Ambo <tazjin@google.com>2020-05-22T02·35+0100
commit68e6e92a20b8ee01de3b89e72fc68517fea6f70c (patch)
treeeb44f148e6cabe0d9281d861a379f7c19cd2783a /third_party/nix/src/libexpr/eval.cc
parent986a8f6b75ffa51682cbe730c5c2907296082cd4 (diff)
chore(3p/nix/libexpr): Delete Bindings::sort r/803
This function does nothing anymore since the attributes are always
in-order.
Diffstat (limited to 'third_party/nix/src/libexpr/eval.cc')
-rw-r--r--third_party/nix/src/libexpr/eval.cc11
1 files changed, 1 insertions, 10 deletions
diff --git a/third_party/nix/src/libexpr/eval.cc b/third_party/nix/src/libexpr/eval.cc
index dbf02134a2..679d3ca996 100644
--- a/third_party/nix/src/libexpr/eval.cc
+++ b/third_party/nix/src/libexpr/eval.cc
@@ -683,7 +683,6 @@ void EvalState::mkPos(Value& v, Pos* pos) {
     mkString(*allocAttr(v, sFile), pos->file);
     mkInt(*allocAttr(v, sLine), pos->line);
     mkInt(*allocAttr(v, sColumn), pos->column);
-    v.attrs->sort();
   } else {
     mkNull(v);
   }
@@ -856,9 +855,7 @@ void ExprAttrs::eval(EvalState& state, Env& env, Value& v) {
        been substituted into the bodies of the other attributes.
        Hence we need __overrides.) */
     if (hasOverrides) {
-      Value* vOverrides =
-          //(*v.attrs)[overrides->second.displ].value;
-          v.attrs->find(overrides->first)->second.value;
+      Value* vOverrides = v.attrs->find(overrides->first)->second.value;
       state.forceAttrs(*vOverrides);
       Bindings* newBnds = state.allocBindings(/* capacity = */ 0);
       for (auto& i : *v.attrs) {  // TODO(tazjin): copy constructor?
@@ -868,13 +865,11 @@ void ExprAttrs::eval(EvalState& state, Env& env, Value& v) {
         auto j = attrs.find(i.second.name);
         if (j != attrs.end()) {
           newBnds->push_back(i.second);
-          // (*newBnds)[j->second.displ] = i;
           env2.values[j->second.displ] = i.second.value;
         } else {
           newBnds->push_back(i.second);
         }
       }
-      newBnds->sort();
       v.attrs = newBnds;
     }
   } else {
@@ -902,10 +897,8 @@ void ExprAttrs::eval(EvalState& state, Env& env, Value& v) {
     }
 
     i.valueExpr->setName(nameSym);
-    /* Keep sorted order so find can catch duplicates */
     v.attrs->push_back(
         Attr(nameSym, i.valueExpr->maybeThunk(state, *dynamicEnv), &i.pos));
-    v.attrs->sort();  // FIXME: inefficient
   }
 }
 
@@ -1224,8 +1217,6 @@ void EvalState::autoCallFunction(Bindings& args, Value& fun, Value& res) {
     }
   }
 
-  actualArgs->attrs->sort();
-
   callFunction(fun, *actualArgs, res, noPos);
 }