From 099a6bc45f9dd091e306809f9510a41968070c5c Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Fri, 9 Dec 2022 20:05:43 +0330 Subject: [PATCH] AK: Give DeprecatedString::replace() a default mode This is used in Jakt, and providing that value from Jakt's side is more trouble than doing this. Considering this class is bound to go away, a little backwards-compatible API change is just fine. --- AK/DeprecatedString.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/DeprecatedString.h b/AK/DeprecatedString.h index c7e4aad728..75cc762e0f 100644 --- a/AK/DeprecatedString.h +++ b/AK/DeprecatedString.h @@ -299,7 +299,7 @@ public: return { characters(), length() }; } - [[nodiscard]] DeprecatedString replace(StringView needle, StringView replacement, ReplaceMode replace_mode) const { return StringUtils::replace(*this, needle, replacement, replace_mode); } + [[nodiscard]] DeprecatedString replace(StringView needle, StringView replacement, ReplaceMode replace_mode = ReplaceMode::All) const { return StringUtils::replace(*this, needle, replacement, replace_mode); } [[nodiscard]] size_t count(StringView needle) const { return StringUtils::count(*this, needle); } [[nodiscard]] DeprecatedString reverse() const;