about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/derivations.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-19T18·40+0100
committerVincent Ambo <tazjin@google.com>2020-05-19T18·40+0100
commit83f4c37adfcb6b74f1030db2c16b89dac9a6164c (patch)
tree49924c93a99ba41c5d536c62cd74ee9fcf3c5e9e /third_party/nix/src/libstore/derivations.cc
parentaf7282536a56e0b00e7c6fe0b3c8cb0a515feb01 (diff)
style(3p/nix/libstore): Additional if/for bracing fixes r/775
Diffstat (limited to 'third_party/nix/src/libstore/derivations.cc')
-rw-r--r--third_party/nix/src/libstore/derivations.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/third_party/nix/src/libstore/derivations.cc b/third_party/nix/src/libstore/derivations.cc
index a46d079672..51bcfbe1ce 100644
--- a/third_party/nix/src/libstore/derivations.cc
+++ b/third_party/nix/src/libstore/derivations.cc
@@ -226,10 +226,11 @@ string Derivation::unparse() const {
 
   bool first = true;
   for (auto& i : outputs) {
-    if (first)
+    if (first) {
       first = false;
-    else
+    } else {
       s += ',';
+    }
     s += '(';
     printString(s, i.first);
     s += ',';
@@ -244,10 +245,11 @@ string Derivation::unparse() const {
   s += "],[";
   first = true;
   for (auto& i : inputDrvs) {
-    if (first)
+    if (first) {
       first = false;
-    else
+    } else {
       s += ',';
+    }
     s += '(';
     printString(s, i.first);
     s += ',';
@@ -268,10 +270,11 @@ string Derivation::unparse() const {
   s += ",[";
   first = true;
   for (auto& i : env) {
-    if (first)
+    if (first) {
       first = false;
-    else
+    } else {
       s += ',';
+    }
     s += '(';
     printString(s, i.first);
     s += ',';
@@ -394,8 +397,9 @@ Source& readDerivation(Source& in, Store& store, BasicDerivation& drv) {
 
 Sink& operator<<(Sink& out, const BasicDerivation& drv) {
   out << drv.outputs.size();
-  for (auto& i : drv.outputs)
+  for (auto& i : drv.outputs) {
     out << i.first << i.second.path << i.second.hashAlgo << i.second.hash;
+  }
   out << drv.inputSrcs << drv.platform << drv.builder << drv.args;
   out << drv.env.size();
   for (auto& i : drv.env) {