From 364e98afc52e81fd54567148f6e6cb4ab9ee9b8b Mon Sep 17 00:00:00 2001 From: Yarvin Date: Sat, 22 Nov 2025 16:52:11 +0100 Subject: [PATCH] Fix String::rfindn for strings with only one character. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ---- Remove optimization – no need to introduce extra complexity for negligible (if any) gains. --- core/string/ustring.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 95cf149ca68..1704bf52cc2 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -3211,11 +3211,6 @@ int String::rfindn(const String &p_str, int p_from) const { return -1; // Still out of bounds } - if (str_len == 1) { - // Optimize with single-char implementation. - return span().rfind(p_str[0], p_from); - } - const char32_t *src = get_data(); const char32_t *str = p_str.get_data();