about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/binary-cache-store.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/libstore/binary-cache-store.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/libstore/binary-cache-store.cc')
-rw-r--r--third_party/nix/src/libstore/binary-cache-store.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/third_party/nix/src/libstore/binary-cache-store.cc b/third_party/nix/src/libstore/binary-cache-store.cc
index bed4e717eb..b0d8c81d80 100644
--- a/third_party/nix/src/libstore/binary-cache-store.cc
+++ b/third_party/nix/src/libstore/binary-cache-store.cc
@@ -120,7 +120,7 @@ void BinaryCacheStore::addToStore(const ValidPathInfo& info,
                                   const ref<std::string>& nar,
                                   RepairFlag repair, CheckSigsFlag checkSigs,
                                   std::shared_ptr<FSAccessor> accessor) {
-  if (!repair && isValidPath(info.path)) {
+  if ((repair == 0u) && isValidPath(info.path)) {
     return;
   }
 
@@ -206,7 +206,7 @@ void BinaryCacheStore::addToStore(const ValidPathInfo& info,
                                       : compression == "bzip2"
                                             ? ".bz2"
                                             : compression == "br" ? ".br" : "");
-  if (repair || !fileExists(narInfo->url)) {
+  if ((repair != 0u) || !fileExists(narInfo->url)) {
     stats.narWrite++;
     upsertFile(narInfo->url, *narCompressed, "application/x-nix-nar");
   } else {
@@ -323,7 +323,7 @@ Path BinaryCacheStore::addTextToStore(const string& name, const string& s,
   info.path = computeStorePathForText(name, s, references);
   info.references = references;
 
-  if (repair || !isValidPath(info.path)) {
+  if ((repair != 0u) || !isValidPath(info.path)) {
     StringSink sink;
     dumpString(s, sink);
     addToStore(info, sink.s, repair, CheckSigs, nullptr);
@@ -362,7 +362,7 @@ std::shared_ptr<std::string> BinaryCacheStore::getBuildLog(const Path& path) {
     try {
       auto info = queryPathInfo(path);
       // FIXME: add a "Log" field to .narinfo
-      if (info->deriver == "") {
+      if (info->deriver.empty()) {
         return nullptr;
       }
       drvPath = info->deriver;