From 3ab3d5555e480e0d18dfdebd4541b7a0eed4859d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 6 Jul 2022 06:24:00 +0200 Subject: [PATCH] util/StringSplit: reimplement without std::distance() Avoid including . --- src/util/StringSplit.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/StringSplit.hxx b/src/util/StringSplit.hxx index 3a9c611d2..8ff1849e1 100644 --- a/src/util/StringSplit.hxx +++ b/src/util/StringSplit.hxx @@ -47,7 +47,7 @@ constexpr std::pair, std::basic_string_view> Partition(const std::basic_string_view haystack, const typename std::basic_string_view::const_pointer position) noexcept { - return Partition(haystack, std::distance(haystack.data(), position)); + return Partition(haystack, position - haystack.data()); } template