Using iterator pattern instead of List::Element *.

Co-authored-by: Adam Scott <ascott.ca@gmail.com>
This commit is contained in:
Yyf2333 2025-02-03 14:16:27 +08:00 committed by Yufeng Ying
parent 594d64ec24
commit 22b5ec17fb
36 changed files with 150 additions and 173 deletions

View file

@ -543,8 +543,8 @@ Vector<LSP::Location> GDScriptWorkspace::find_all_usages(const LSP::DocumentSymb
list_script_files("res://", paths);
Vector<LSP::Location> usages;
for (List<String>::Element *PE = paths.front(); PE; PE = PE->next()) {
usages.append_array(find_usages_in_file(p_symbol, PE->get()));
for (const String &path : paths) {
usages.append_array(find_usages_in_file(p_symbol, path));
}
return usages;
}