From 09cbc431cca08be891e5e792ceda2a34956b2fc8 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 19 May 2020 18:01:12 +0100 Subject: fix(3p/nix): Fix incorrectly braced conditionals and loops Fixes mistakes introduced by clang-tidy in the previous commit. --- third_party/nix/src/libexpr/value-to-xml.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'third_party/nix/src/libexpr/value-to-xml.cc') diff --git a/third_party/nix/src/libexpr/value-to-xml.cc b/third_party/nix/src/libexpr/value-to-xml.cc index 5ea1e09824c7..6247d25b9c34 100644 --- a/third_party/nix/src/libexpr/value-to-xml.cc +++ b/third_party/nix/src/libexpr/value-to-xml.cc @@ -137,15 +137,20 @@ static void printValueAsXML(EvalState& state, bool strict, bool location, if (v.lambda.fun->matchAttrs) { XMLAttrs attrs; - if (!v.lambda.fun->arg.empty()) attrs["name"] = v.lambda.fun->arg; - if (v.lambda.fun->formals->ellipsis) attrs["ellipsis"] = "1"; + if (!v.lambda.fun->arg.empty()) { + attrs["name"] = v.lambda.fun->arg; + } + if (v.lambda.fun->formals->ellipsis) { + attrs["ellipsis"] = "1"; + } XMLOpenElement _(doc, "attrspat", attrs); - for (auto& i : v.lambda.fun->formals->formals) + for (auto& i : v.lambda.fun->formals->formals) { doc.writeEmptyElement("attr", singletonAttrs("name", i.name)); + } } else { - doc + doc.writeEmptyElement("varpat", + singletonAttrs("name", v.lambda.fun->arg)); } - .writeEmptyElement("varpat", singletonAttrs("name", v.lambda.fun->arg)); break; } -- cgit 1.4.1