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/store-api.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'third_party/nix/src/libstore/store-api.cc') diff --git a/third_party/nix/src/libstore/store-api.cc b/third_party/nix/src/libstore/store-api.cc index 9440d78d5f..afdbc14e29 100644 --- a/third_party/nix/src/libstore/store-api.cc +++ b/third_party/nix/src/libstore/store-api.cc @@ -5,6 +5,7 @@ #include #include +#include #include #include "crypto.hh" @@ -858,7 +859,8 @@ std::pair splitUriAndParams( Store::Params params; auto q = uri.find('?'); if (q != std::string::npos) { - for (const auto& s : tokenizeString(uri.substr(q + 1), "&")) { + Strings parts = absl::StrSplit(uri.substr(q + 1), absl::ByChar('&')); + for (const auto& s : parts) { auto e = s.find('='); if (e != std::string::npos) { auto value = s.substr(e + 1); -- cgit 1.4.1