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/libstore/pathlocks.cc | |
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/libstore/pathlocks.cc')
-rw-r--r-- | third_party/nix/src/libstore/pathlocks.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/third_party/nix/src/libstore/pathlocks.cc b/third_party/nix/src/libstore/pathlocks.cc index ac6d260f8414..eeee5ee1e9c9 100644 --- a/third_party/nix/src/libstore/pathlocks.cc +++ b/third_party/nix/src/libstore/pathlocks.cc @@ -53,9 +53,8 @@ bool lockFile(int fd, LockType lockType, bool wait) { checkInterrupt(); if (errno != EINTR) { throw SysError(format("acquiring/releasing lock")); - } else { - return false; } + return false; } } else { while (flock(fd, type | LOCK_NB) != 0) { @@ -104,7 +103,7 @@ bool PathLocks::lockPaths(const PathSet& paths, const string& waitMsg, /* Acquire an exclusive lock. */ if (!lockFile(fd.get(), ltWrite, false)) { if (wait) { - if (waitMsg != "") { + if (!waitMsg.empty()) { LOG(WARNING) << waitMsg; } lockFile(fd.get(), ltWrite, true); |