From 4fe27ec2a775fa20b7b8f20adabf7d93a17d3fac Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Tue, 12 Jan 2021 23:30:44 +0330 Subject: [PATCH] AK: Use StringView::find() in StringView::split_view() This fixes #4926. --- AK/StringView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AK/StringView.cpp b/AK/StringView.cpp index 42e7cb467c..0c7679d42f 100644 --- a/AK/StringView.cpp +++ b/AK/StringView.cpp @@ -86,14 +86,14 @@ Vector StringView::split_view(const StringView& separator, bool keep Vector parts; - auto maybe_separator_index = find_first_of(separator); + auto maybe_separator_index = find(separator); while (maybe_separator_index.has_value()) { auto separator_index = maybe_separator_index.value(); auto part_with_separator = view.substring_view(0, separator_index + separator.length()); if (keep_empty || separator_index > 0) parts.append(part_with_separator.substring_view(0, separator_index)); view = view.substring_view_starting_after_substring(part_with_separator); - maybe_separator_index = view.find_first_of(separator); + maybe_separator_index = view.find(separator); } if (keep_empty || !view.is_empty()) parts.append(view);