about summary refs log tree commit diff
path: root/third_party/nix/src/libstore/builtins/buildenv.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/builtins/buildenv.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/builtins/buildenv.cc')
-rw-r--r--third_party/nix/src/libstore/builtins/buildenv.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/third_party/nix/src/libstore/builtins/buildenv.cc b/third_party/nix/src/libstore/builtins/buildenv.cc
index d14474a93d7e..92cf2f8c1eec 100644
--- a/third_party/nix/src/libstore/builtins/buildenv.cc
+++ b/third_party/nix/src/libstore/builtins/buildenv.cc
@@ -1,5 +1,6 @@
 #include <algorithm>
 
+#include <absl/strings/match.h>
 #include <fcntl.h>
 #include <glog/logging.h>
 #include <sys/stat.h>
@@ -56,10 +57,10 @@ static void createLinks(const Path& srcDir, const Path& dstDir, int priority) {
      * Python package brings its own
      * `$out/lib/pythonX.Y/site-packages/easy-install.pth'.)
      */
-    if (hasSuffix(srcFile, "/propagated-build-inputs") ||
-        hasSuffix(srcFile, "/nix-support") ||
-        hasSuffix(srcFile, "/perllocal.pod") ||
-        hasSuffix(srcFile, "/info/dir") || hasSuffix(srcFile, "/log"))
+    if (absl::EndsWith(srcFile, "/propagated-build-inputs") ||
+        absl::EndsWith(srcFile, "/nix-support") ||
+        absl::EndsWith(srcFile, "/perllocal.pod") ||
+        absl::EndsWith(srcFile, "/info/dir") || absl::EndsWith(srcFile, "/log"))
       continue;
 
     else if (S_ISDIR(srcSt.st_mode)) {