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/profiles.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/profiles.cc')
-rw-r--r-- | third_party/nix/src/libstore/profiles.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/third_party/nix/src/libstore/profiles.cc b/third_party/nix/src/libstore/profiles.cc index 3abdfaf1389f..7d16d9f62390 100644 --- a/third_party/nix/src/libstore/profiles.cc +++ b/third_party/nix/src/libstore/profiles.cc @@ -31,9 +31,8 @@ static int parseName(const string& profileName, const string& name) { int n; if (string2Int(string(s, 0, p), n) && n >= 0) { return n; - } else { - return -1; } + return -1; } Generations findGenerations(Path profile, int& curGen) { @@ -76,7 +75,7 @@ Path createGeneration(ref<LocalFSStore> store, Path profile, Path outPath) { Generations gens = findGenerations(profile, dummy); unsigned int num; - if (gens.size() > 0) { + if (!gens.empty()) { Generation last = gens.back(); if (readLink(last.path) == outPath) { @@ -165,7 +164,7 @@ void deleteGenerationsGreaterThan(const Path& profile, int max, bool dryRun) { continue; } if (fromCurGen) { - if (max) { + if (max != 0) { max--; continue; } |