You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-01 16:38:31 +00:00
Fix String::rfindn for strings with only one character.
---- Remove optimization – no need to introduce extra complexity for negligible (if any) gains.
This commit is contained in:
@@ -3211,11 +3211,6 @@ int String::rfindn(const String &p_str, int p_from) const {
|
|||||||
return -1; // Still out of bounds
|
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 *src = get_data();
|
||||||
const char32_t *str = p_str.get_data();
|
const char32_t *str = p_str.get_data();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user