diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-20T21·27+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-20T21·27+0100 |
commit | 689ef502f5b0655c9923ed77da2ae3504630f473 (patch) | |
tree | 3e331c153646f136875f047cc3b9f0aad8c86341 /third_party/nix/src/build-remote | |
parent | d331d3a0b5c497a46e2636f308234be66566c04c (diff) |
refactor(3p/nix): Apply clang-tidy's readability-* fixes r/788
This applies the readability fixes listed here: https://clang.llvm.org/extra/clang-tidy/checks/list.html
Diffstat (limited to 'third_party/nix/src/build-remote')
-rw-r--r-- | third_party/nix/src/build-remote/build-remote.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/third_party/nix/src/build-remote/build-remote.cc b/third_party/nix/src/build-remote/build-remote.cc index 70776b132d14..2802b49ac8ea 100644 --- a/third_party/nix/src/build-remote/build-remote.cc +++ b/third_party/nix/src/build-remote/build-remote.cc @@ -40,7 +40,7 @@ static AutoCloseFD openSlotLock(const Machine& m, unsigned long long slot) { static bool allSupportedLocally(const std::set<std::string>& requiredFeatures) { for (auto& feature : requiredFeatures) { - if (!settings.systemFeatures.get().count(feature)) { + if (settings.systemFeatures.get().count(feature) == 0u) { return false; } } @@ -60,7 +60,7 @@ static int _main(int argc, char* argv[]) { FdSource source(STDIN_FILENO); /* Read the parent's settings. */ - while (readInt(source)) { + while (readInt(source) != 0u) { auto name = readString(source); auto value = readString(source); settings.set(name, value); @@ -106,7 +106,7 @@ static int _main(int argc, char* argv[]) { auto requiredFeatures = readStrings<std::set<std::string>>(source); auto canBuildLocally = - amWilling && + (amWilling != 0u) && (neededSystem == settings.thisSystem || settings.extraPlatforms.get().count(neededSystem) > 0) && allSupportedLocally(requiredFeatures); @@ -196,7 +196,7 @@ static int _main(int argc, char* argv[]) { if (hasPrefix(bestMachine->storeUri, "ssh://")) { storeParams["max-connections"] = "1"; storeParams["log-fd"] = "4"; - if (bestMachine->sshKey != "") { + if (!bestMachine->sshKey.empty()) { storeParams["ssh-key"] = bestMachine->sshKey; } } |