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/libstore/nar-info.cc
vendored
3
third_party/nix/src/libstore/nar-info.cc
vendored
|
|
@ -1,6 +1,7 @@
|
|||
#include "nar-info.hh"
|
||||
|
||||
#include <absl/strings/numbers.h>
|
||||
#include <absl/strings/str_split.h>
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
|
|
@ -59,7 +60,7 @@ NarInfo::NarInfo(const Store& store, const std::string& s,
|
|||
corrupt();
|
||||
}
|
||||
} else if (name == "References") {
|
||||
auto refs = tokenizeString<Strings>(value, " ");
|
||||
std::vector<std::string> refs = absl::StrSplit(value, absl::ByChar(' '));
|
||||
if (!references.empty()) {
|
||||
corrupt();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue