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.
This commit is contained in:
Vincent Ambo 2020-05-25 15:54:14 +01:00
parent b99b368d17
commit bf452cbc2a
29 changed files with 146 additions and 145 deletions

View file

@ -4,6 +4,7 @@
#include <cstring>
#include <regex>
#include <absl/strings/str_split.h>
#include <dlfcn.h>
#include <glog/logging.h>
#include <sys/stat.h>
@ -712,7 +713,7 @@ static void prim_derivationStrict(EvalState& state, const Pos& pos,
} else if (i->name == state.sOutputHashMode) {
handleHashMode(s);
} else if (i->name == state.sOutputs) {
handleOutputs(tokenizeString<Strings>(s));
handleOutputs(absl::StrSplit(s, absl::ByAnyChar(" \t\n\r")));
}
}
}