You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Use C++ iterators for Lists in many situations
This commit is contained in:
@@ -1459,8 +1459,8 @@ void GDScriptByteCodeGenerator::write_endfor() {
|
||||
}
|
||||
|
||||
// Patch break statements.
|
||||
for (const List<int>::Element *E = current_breaks_to_patch.back()->get().front(); E; E = E->next()) {
|
||||
patch_jump(E->get());
|
||||
for (const int &E : current_breaks_to_patch.back()->get()) {
|
||||
patch_jump(E);
|
||||
}
|
||||
current_breaks_to_patch.pop_back();
|
||||
|
||||
@@ -1494,8 +1494,8 @@ void GDScriptByteCodeGenerator::write_endwhile() {
|
||||
while_jmp_addrs.pop_back();
|
||||
|
||||
// Patch break statements.
|
||||
for (const List<int>::Element *E = current_breaks_to_patch.back()->get().front(); E; E = E->next()) {
|
||||
patch_jump(E->get());
|
||||
for (const int &E : current_breaks_to_patch.back()->get()) {
|
||||
patch_jump(E);
|
||||
}
|
||||
current_breaks_to_patch.pop_back();
|
||||
}
|
||||
@@ -1506,8 +1506,8 @@ void GDScriptByteCodeGenerator::start_match() {
|
||||
|
||||
void GDScriptByteCodeGenerator::start_match_branch() {
|
||||
// Patch continue statements.
|
||||
for (const List<int>::Element *E = match_continues_to_patch.back()->get().front(); E; E = E->next()) {
|
||||
patch_jump(E->get());
|
||||
for (const int &E : match_continues_to_patch.back()->get()) {
|
||||
patch_jump(E);
|
||||
}
|
||||
match_continues_to_patch.pop_back();
|
||||
// Start a new list for next branch.
|
||||
@@ -1516,8 +1516,8 @@ void GDScriptByteCodeGenerator::start_match_branch() {
|
||||
|
||||
void GDScriptByteCodeGenerator::end_match() {
|
||||
// Patch continue statements.
|
||||
for (const List<int>::Element *E = match_continues_to_patch.back()->get().front(); E; E = E->next()) {
|
||||
patch_jump(E->get());
|
||||
for (const int &E : match_continues_to_patch.back()->get()) {
|
||||
patch_jump(E);
|
||||
}
|
||||
match_continues_to_patch.pop_back();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user