Merge pull request #80809 from jsjtxietian/early-quit-in-_get_column_pos_of_word
Edit early in `TextEdit::_get_column_pos_of_word` to improve highlight performace
This commit is contained in:
commit
76a4b5d710
|
@ -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);
|
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.
|
// Whole words only.
|
||||||
if (col != -1 && p_search_flags & SEARCH_WHOLE_WORDS) {
|
if (col != -1 && p_search_flags & SEARCH_WHOLE_WORDS) {
|
||||||
p_from_column = col;
|
p_from_column = col;
|
||||||
|
|
Loading…
Reference in New Issue