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:
parent
b99b368d17
commit
bf452cbc2a
29 changed files with 146 additions and 145 deletions
3
third_party/nix/src/libexpr/primops.cc
vendored
3
third_party/nix/src/libexpr/primops.cc
vendored
|
@ -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")));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue