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

@ -144,9 +144,7 @@ Dictionary DebugAdapterParser::req_initialize(const Dictionary &p_params) const
// Send all current breakpoints
List<String> breakpoints;
ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);
for (List<String>::Element *E = breakpoints.front(); E; E = E->next()) {
String breakpoint = E->get();
for (const String &breakpoint : breakpoints) {
String path = breakpoint.left(breakpoint.find_char(':', 6)); // Skip initial part of path, aka "res://"
int line = breakpoint.substr(path.size()).to_int();