summaryrefslogtreecommitdiff
path: root/scene/main
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-26 19:45:04 +0200
committerGitHub <noreply@github.com>2021-07-26 19:45:04 +0200
commitfab3412139ce6b4befcba950896e45a44365e2f6 (patch)
treed6091ad1438d41eed088ed28a60cfed0c7e6663b /scene/main
parenta504e4d4c3af53bb21a0013132719affd3e21798 (diff)
parent92299989bd10fd9855b6d77bc2bfabae218d1eea (diff)
Merge pull request #50899 from akien-mga/refref
Use Ref<T> references as iterators where relevant
Diffstat (limited to 'scene/main')
-rw-r--r--scene/main/scene_tree.cpp8
-rw-r--r--scene/main/viewport.cpp2
2 files changed, 5 insertions, 5 deletions
diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp
index c8dec72db4..dcbbebbc55 100644
--- a/scene/main/scene_tree.cpp
+++ b/scene/main/scene_tree.cpp
@@ -571,8 +571,8 @@ void SceneTree::finalize() {
}
// cleanup timers
- for (Ref<SceneTreeTimer> E : timers) {
- E->release_connections();
+ for (Ref<SceneTreeTimer> &timer : timers) {
+ timer->release_connections();
}
timers.clear();
}
@@ -1146,8 +1146,8 @@ Array SceneTree::get_processed_tweens() {
ret.resize(tweens.size());
int i = 0;
- for (Ref<Tween> E : tweens) {
- ret[i] = E;
+ for (const Ref<Tween> &tween : tweens) {
+ ret[i] = tween;
i++;
}
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 4231072ed9..27e42db1bd 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -573,7 +573,7 @@ void Viewport::_process_picking() {
// if no mouse event exists, create a motion one. This is necessary because objects or camera may have moved.
// while this extra event is sent, it is checked if both camera and last object and last ID did not move. If nothing changed, the event is discarded to avoid flooding with unnecessary motion events every frame
bool has_mouse_event = false;
- for (Ref<InputEvent> m : physics_picking_events) {
+ for (const Ref<InputEvent> &m : physics_picking_events) {
if (m.is_valid()) {
has_mouse_event = true;
break;