mirror of
https://github.com/godotengine/godot.git
synced 2025-02-17 22:43:01 +08:00
Fixes a text find perf issue, if can't find any
match words, just early break the while loop. This will improve a lot when p_search.length is way too long since p_from_column will only plus 1 every loop
This commit is contained in:
parent
5444afae63
commit
70dad7e5a3
@ -7000,6 +7000,11 @@ int TextEdit::_get_column_pos_of_word(const String &p_key, const String &p_searc
|
||||
col = p_search.findn(p_key, p_from_column);
|
||||
}
|
||||
|
||||
// If not found, just break early to improve performance.
|
||||
if (col == -1) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Whole words only.
|
||||
if (col != -1 && p_search_flags & SEARCH_WHOLE_WORDS) {
|
||||
p_from_column = col;
|
||||
|
Loading…
Reference in New Issue
Block a user