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

@ -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();
}