util/IterableSplitString: use StringView::Split()

This commit is contained in:
Max Kellermann 2022-06-30 20:37:04 +02:00
parent aadd32c973
commit 0173d3b313
1 changed files with 3 additions and 10 deletions

View File

@ -76,16 +76,9 @@ public:
if (rest == nullptr)
current = nullptr;
else {
const auto *i = rest.Find(separator);
if (i == nullptr) {
current = rest;
rest.data = nullptr;
} else {
current.data = rest.data;
current.size = i - current.data;
rest.size -= current.size + 1;
rest.data = i + 1;
}
const auto [a, b] = rest.Split(separator);
current = a;
rest = b;
}
}