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-19T17·01+0100
committerVincent Ambo <tazjin@google.com>2020-05-19T17·01+0100
commit09cbc431cca08be891e5e792ceda2a34956b2fc8 (patch)
tree3653448c7e074bdfd10dfa3bc3b5dfe952299fdf /third_party/nix/src/libexpr/eval.cc
parentb490742a511dd03afc43f5143d6d61edaeeb8091 (diff)
fix(3p/nix): Fix incorrectly braced conditionals and loops r/768
Fixes mistakes introduced by clang-tidy in the previous commit.
Diffstat (limited to 'third_party/nix/src/libexpr/eval.cc')
-rw-r--r--third_party/nix/src/libexpr/eval.cc18
1 files changed, 6 insertions, 12 deletions
diff --git a/third_party/nix/src/libexpr/eval.cc b/third_party/nix/src/libexpr/eval.cc
index 19f6a46ed655..5d6f30c07d0c 100644
--- a/third_party/nix/src/libexpr/eval.cc
+++ b/third_party/nix/src/libexpr/eval.cc
@@ -820,15 +820,12 @@ void ExprAttrs::eval(EvalState& state, Env& env, Value& v) {
       newBnds->sort();
       v.attrs = newBnds;
     }
+  } else {
+    for (auto& i : attrs)
+      v.attrs->push_back(
+          Attr(i.first, i.second.e->maybeThunk(state, env), &i.second.pos));
   }
 
-  else {
-    for
-  }
-  (auto& i
-   : attrs) v.attrs->push_back(Attr(i.first, i.second.e->maybeThunk(state, env),
-                                    &i.second.pos));
-
   /* Dynamic attrs apply *after* rec and __overrides. */
   for (auto& i : dynamicAttrs) {
     Value nameVal;
@@ -1350,9 +1347,8 @@ void ExprConcatStrings::eval(EvalState& state, Env& env, Value& v) {
     auto path = canonPath(s.str());
     mkPath(v, path.c_str());
   } else {
-    mkString
+    mkString(v, s.str(), context);
   }
-  (v, s.str(), context);
 }
 
 void ExprPos::eval(EvalState& state, Env& env, Value& v) {
@@ -1378,9 +1374,7 @@ void EvalState::forceValueDeep(Value& v) {
                          i.name, *i.pos);
           throw;
         }
-    }
-
-    else if (v.isList()) {
+    } else if (v.isList()) {
       for (size_t n = 0; n < v.listSize(); ++n) recurse(*v.listElems()[n]);
     }
   };