about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/gc.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-25T01·19+0100
committerVincent Ambo <tazjin@google.com>2020-05-25T01·19+0100
commitb99b368d17f2e806a61f7abb83c6d3a9e4bbdc38 (patch)
tree1f76047dd027421dcf79cdf4804fa5ff1bb08b2b /third_party/nix/src/libstore/gc.cc
parent8cf1322a6fd5ae282d8a09fdba634f27a1a88560 (diff)
refactor(3p/nix/libutil): Replace hasPrefix/Suffix with Abseil r/845
Uses the equivalent absl::StartsWith and absl::EndsWith functions
instead.
Diffstat (limited to 'third_party/nix/src/libstore/gc.cc')
-rw-r--r--third_party/nix/src/libstore/gc.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/third_party/nix/src/libstore/gc.cc b/third_party/nix/src/libstore/gc.cc
index 1b2364c25383..262f17df0338 100644
--- a/third_party/nix/src/libstore/gc.cc
+++ b/third_party/nix/src/libstore/gc.cc
@@ -6,6 +6,7 @@
 #include <random>
 #include <regex>
 
+#include <absl/strings/match.h>
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/statvfs.h>
@@ -512,7 +513,7 @@ struct LocalStore::GCState {
 
 bool LocalStore::isActiveTempFile(const GCState& state, const Path& path,
                                   const std::string& suffix) {
-  return hasSuffix(path, suffix) &&
+  return absl::EndsWith(path, suffix) &&
          state.tempRoots.find(std::string(
              path, 0, path.size() - suffix.size())) != state.tempRoots.end();
 }