summaryrefslogtreecommitdiff
path: root/AK/StringView.cpp
diff options
context:
space:
mode:
authorDexesTTP <dexes.ttp@gmail.com>2022-07-05 22:33:15 +0200
committerLinus Groh <mail@linusgroh.de>2022-07-06 11:12:45 +0200
commit7ceeb745354e246ec91cbdcd6f17c8291c09aec0 (patch)
treeff0acc8f5603d392e0f0b82793df40b257e284ea /AK/StringView.cpp
parentb2454888e8fa44775456536a2a71827763cba503 (diff)
downloadserenity-7ceeb745354e246ec91cbdcd6f17c8291c09aec0.zip
AK: Use an enum instead of a bool for String::replace(all_occurences)
This commit has no behavior changes. In particular, this does not fix any of the wrong uses of the previous default parameter (which used to be 'false', meaning "only replace the first occurence in the string"). It simply replaces the default uses by String::replace(..., ReplaceMode::FirstOnly), leaving them incorrect.
Diffstat (limited to 'AK/StringView.cpp')
-rw-r--r--AK/StringView.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/AK/StringView.cpp b/AK/StringView.cpp
index e1fd99809f..c9b1cbc703 100644
--- a/AK/StringView.cpp
+++ b/AK/StringView.cpp
@@ -228,9 +228,9 @@ bool StringView::operator==(String const& string) const
String StringView::to_string() const { return String { *this }; }
-String StringView::replace(StringView needle, StringView replacement, bool all_occurrences) const
+String StringView::replace(StringView needle, StringView replacement, ReplaceMode replace_mode) const
{
- return StringUtils::replace(*this, needle, replacement, all_occurrences);
+ return StringUtils::replace(*this, needle, replacement, replace_mode);
}
#endif