From 867055133d3f487e52dd44149f76347c2c28bf10 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 19 May 2020 18:55:58 +0100 Subject: style(3p/nix): Add braces around single-line conditionals These were not caught by the previous clang-tidy invocation, but were instead sorted out using amber[0] as such: ambr --regex 'if (\(.+\))\s([a-z].*;)' 'if $1 { $2 }' [0]: https://github.com/dalance/amber --- third_party/nix/src/libstore/references.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'third_party/nix/src/libstore/references.cc') diff --git a/third_party/nix/src/libstore/references.cc b/third_party/nix/src/libstore/references.cc index 63cd284732a6..a46bdc758fbf 100644 --- a/third_party/nix/src/libstore/references.cc +++ b/third_party/nix/src/libstore/references.cc @@ -35,7 +35,9 @@ static void search(const unsigned char* s, size_t len, StringSet& hashes, match = false; break; } - if (!match) continue; + if (!match) { + continue; + } string ref((const char*)s + i, refLength); if (hashes.find(ref) != hashes.end()) { DLOG(INFO) << "found reference to '" << ref << "' at offset " << i; @@ -88,7 +90,9 @@ PathSet scanForReferences(const string& path, const PathSet& refs, for (auto& i : refs) { string baseName = baseNameOf(i); string::size_type pos = baseName.find('-'); - if (pos == string::npos) throw Error(format("bad reference '%1%'") % i); + if (pos == string::npos) { + throw Error(format("bad reference '%1%'") % i); + } string s = string(baseName, 0, pos); assert(s.size() == refLength); assert(backMap.find(s) == backMap.end()); @@ -104,7 +108,9 @@ PathSet scanForReferences(const string& path, const PathSet& refs, PathSet found; for (auto& i : sink.seen) { std::map::iterator j; - if ((j = backMap.find(i)) == backMap.end()) abort(); + if ((j = backMap.find(i)) == backMap.end()) { + abort(); + } found.insert(j->second); } -- cgit 1.4.1