Explorar o código

Fix whole word search slowdown in editor

Reduce repeated iteration through the full text
when counting the number of occurrences of whole
words while searching a file in the editor.
Maganty Rushyendra %!s(int64=5) %!d(string=hai) anos
pai
achega
2433287871
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      editor/code_editor.cpp

+ 1 - 1
editor/code_editor.cpp

@@ -308,7 +308,7 @@ void FindReplaceBar::_update_results_count() {
 		}
 
 		if (is_whole_words()) {
-			from_pos++; // Making sure we won't hit the same match next time, if we get out via a continue.
+			from_pos = pos + 1; // Making sure we won't hit the same match next time, if we get out via a continue.
 			if (pos > 0 && !is_symbol(full_text[pos - 1])) {
 				continue;
 			}