From 0173d3b3137b7e17648b339db00cae3a9ff18857 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 30 Jun 2022 20:37:04 +0200 Subject: [PATCH] util/IterableSplitString: use StringView::Split() --- src/util/IterableSplitString.hxx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/util/IterableSplitString.hxx b/src/util/IterableSplitString.hxx index a8388b63f..2b02f06ac 100644 --- a/src/util/IterableSplitString.hxx +++ b/src/util/IterableSplitString.hxx @@ -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; } }