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/ssh.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'third_party/nix/src/libstore/ssh.cc') diff --git a/third_party/nix/src/libstore/ssh.cc b/third_party/nix/src/libstore/ssh.cc index 76c78b2fcd77..1b09eb42c6b9 100644 --- a/third_party/nix/src/libstore/ssh.cc +++ b/third_party/nix/src/libstore/ssh.cc @@ -3,6 +3,7 @@ #include #include +#include namespace nix { @@ -20,8 +21,9 @@ SSHMaster::SSHMaster(const std::string& host, std::string keyFile, } void SSHMaster::addCommonSSHOpts(Strings& args) { - for (auto& i : tokenizeString(getEnv("NIX_SSHOPTS"))) { - args.push_back(i); + for (auto& i : + absl::StrSplit(getEnv("NIX_SSHOPTS"), absl::ByAnyChar(" \t\n\r"))) { + args.push_back(std::string(i)); } if (!keyFile.empty()) { args.insert(args.end(), {"-i", keyFile}); -- cgit 1.4.1