about summary refs log tree commit diff
path: root/third_party/nix/src/nix/why-depends.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-20T21·27+0100
committerVincent Ambo <tazjin@google.com>2020-05-20T21·27+0100
commit689ef502f5b0655c9923ed77da2ae3504630f473 (patch)
tree3e331c153646f136875f047cc3b9f0aad8c86341 /third_party/nix/src/nix/why-depends.cc
parentd331d3a0b5c497a46e2636f308234be66566c04c (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/nix/why-depends.cc')
-rw-r--r--third_party/nix/src/nix/why-depends.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/third_party/nix/src/nix/why-depends.cc b/third_party/nix/src/nix/why-depends.cc
index baf27a6951..bbbfd1fe01 100644
--- a/third_party/nix/src/nix/why-depends.cc
+++ b/third_party/nix/src/nix/why-depends.cc
@@ -18,7 +18,7 @@ static std::string hilite(const std::string& s, size_t pos, size_t len,
 static std::string filterPrintable(const std::string& s) {
   std::string res;
   for (char c : s) {
-    res += isprint(c) ? c : '.';
+    res += isprint(c) != 0 ? c : '.';
   }
   return res;
 }
@@ -70,7 +70,7 @@ struct CmdWhyDepends : SourceExprCommand {
     PathSet closure;
     store->computeFSClosure({packagePath}, closure, false, false);
 
-    if (!closure.count(dependencyPath)) {
+    if (closure.count(dependencyPath) == 0u) {
       LOG(WARNING) << "'" << package->what() << "' does not depend on '"
                    << dependency->what() << "'";
       return;
@@ -146,7 +146,7 @@ struct CmdWhyDepends : SourceExprCommand {
       assert(node.dist != inf);
       std::cout << fmt("%s%s%s%s" ANSI_NORMAL "\n", firstPad,
                        node.visited ? "\e[38;5;244m" : "",
-                       firstPad != "" ? "=> " : "", node.path);
+                       !firstPad.empty() ? "=> " : "", node.path);
 
       if (node.path == dependencyPath && !all &&
           packagePath != dependencyPath) {