From bf452cbc2ae2b209ec262ce858deca470d086f24 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 25 May 2020 15:54:14 +0100 Subject: refactor(3p/nix): Replace tokenizeStrings with absl::StrSplit This function was a custom (and inefficient in the case of single-character delimiters) string splitter which was used all over the codebase. Abseil provides an appropriate replacement function. --- third_party/nix/src/libexpr/primops/fetchGit.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'third_party/nix/src/libexpr/primops/fetchGit.cc') diff --git a/third_party/nix/src/libexpr/primops/fetchGit.cc b/third_party/nix/src/libexpr/primops/fetchGit.cc index 99f1c3c4ba..2cfdefe7ab 100644 --- a/third_party/nix/src/libexpr/primops/fetchGit.cc +++ b/third_party/nix/src/libexpr/primops/fetchGit.cc @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -54,8 +55,9 @@ GitInfo exportGit(ref store, const std::string& uri, gitInfo.rev = "0000000000000000000000000000000000000000"; gitInfo.shortRev = std::string(gitInfo.rev, 0, 7); - auto files = tokenizeString>( - runProgram("git", true, {"-C", uri, "ls-files", "-z"}), "\0"s); + std::set files = + absl::StrSplit(runProgram("git", true, {"-C", uri, "ls-files", "-z"}), + absl::ByChar('\0')); PathFilter filter = [&](const Path& p) -> bool { assert(absl::StartsWith(p, uri)); -- cgit 1.4.1