diff options
| author | Rémi Verschelde <remi@verschelde.fr> | 2021-07-24 14:21:06 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-24 14:21:06 +0200 |
| commit | 96d7bc62af25b85b8b9cc091eeea1e7a784ba624 (patch) | |
| tree | 83d8a70c911fe7f8d20080a1395d195eb8370d05 /modules/gdscript/gdscript_function.cpp | |
| parent | 9ac27b58c53b50b5c7085a8fdee653e9eff159d1 (diff) | |
| parent | 4e6efd1b07f1c6d53d226977ddc729333b74306a (diff) | |
| download | redot-engine-96d7bc62af25b85b8b9cc091eeea1e7a784ba624.tar.gz | |
Merge pull request #50511 from aaronfranke/iterators
Use C++ range iterators for Lists in many situations
Diffstat (limited to 'modules/gdscript/gdscript_function.cpp')
| -rw-r--r-- | modules/gdscript/gdscript_function.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/gdscript/gdscript_function.cpp b/modules/gdscript/gdscript_function.cpp index f300d5a2c9..876c508689 100644 --- a/modules/gdscript/gdscript_function.cpp +++ b/modules/gdscript/gdscript_function.cpp @@ -94,8 +94,7 @@ struct _GDFKCS { void GDScriptFunction::debug_get_stack_member_state(int p_line, List<Pair<StringName, int>> *r_stackvars) const { int oc = 0; Map<StringName, _GDFKC> sdmap; - for (const List<StackDebug>::Element *E = stack_debug.front(); E; E = E->next()) { - const StackDebug &sd = E->get(); + for (const StackDebug &sd : stack_debug) { if (sd.line > p_line) { break; } @@ -131,10 +130,10 @@ void GDScriptFunction::debug_get_stack_member_state(int p_line, List<Pair<String stackpositions.sort(); - for (List<_GDFKCS>::Element *E = stackpositions.front(); E; E = E->next()) { + for (_GDFKCS &E : stackpositions) { Pair<StringName, int> p; - p.first = E->get().id; - p.second = E->get().pos; + p.first = E.id; + p.second = E.pos; r_stackvars->push_back(p); } } |
