refactor(3p/nix/libutil): Replace hasPrefix/Suffix with Abseil

Uses the equivalent absl::StartsWith and absl::EndsWith functions
instead.
This commit is contained in:
Vincent Ambo 2020-05-25 02:19:01 +01:00
parent 8cf1322a6f
commit b99b368d17
21 changed files with 69 additions and 57 deletions

View file

@ -1,5 +1,7 @@
#include <utility>
#include <absl/strings/match.h>
#include "binary-cache-store.hh"
#include "globals.hh"
#include "nar-info-disk-cache.hh"
@ -39,7 +41,7 @@ class LocalBinaryCacheStore : public BinaryCacheStore {
PathSet paths;
for (auto& entry : readDirectory(binaryCacheDir)) {
if (entry.name.size() != 40 || !hasSuffix(entry.name, ".narinfo")) {
if (entry.name.size() != 40 || !absl::EndsWith(entry.name, ".narinfo")) {
continue;
}
paths.insert(storeDir + "/" +