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/libstore/binary-cache-store.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'third_party/nix/src/libstore/binary-cache-store.cc') diff --git a/third_party/nix/src/libstore/binary-cache-store.cc b/third_party/nix/src/libstore/binary-cache-store.cc index ea36078435ba..f631c9dee231 100644 --- a/third_party/nix/src/libstore/binary-cache-store.cc +++ b/third_party/nix/src/libstore/binary-cache-store.cc @@ -6,6 +6,7 @@ #include #include +#include #include "archive.hh" #include "compression.hh" @@ -41,7 +42,7 @@ void BinaryCacheStore::init() { upsertFile(cacheInfoFile, "StoreDir: " + storeDir + "\n", "text/x-nix-cache-info"); } else { - for (auto& line : tokenizeString(*cacheInfo, "\n")) { + for (auto& line : absl::StrSplit(*cacheInfo, absl::ByChar('\n'))) { size_t colon = line.find(':'); if (colon == std::string::npos) { continue; -- cgit 1.4.1