Browse Source

LibWeb: Avoid unnecessary Vector copy during find in page queries

Tim Ledbetter 8 months ago
parent
commit
7b389ca221
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Libraries/LibWeb/Page/Page.cpp

+ 1 - 1
Libraries/LibWeb/Page/Page.cpp

@@ -620,7 +620,7 @@ Page::FindInPageResult Page::perform_find_in_page_query(FindInPageQuery const& q
         return 0;
         return 0;
     };
     };
 
 
-    for (auto document : documents_in_active_window()) {
+    for (auto const& document : documents_in_active_window()) {
         auto matches = document->find_matching_text(query.string, query.case_sensitivity);
         auto matches = document->find_matching_text(query.string, query.case_sensitivity);
         if (document == top_level_traversable()->active_document()) {
         if (document == top_level_traversable()->active_document()) {
             auto new_match_index = find_current_match_index(*document, matches);
             auto new_match_index = find_current_match_index(*document, matches);