From 900c676b0282bed83d00834e3c280ac89c2bc94d Mon Sep 17 00:00:00 2001 From: Aaron Record Date: Wed, 18 May 2022 17:43:40 -0600 Subject: Use range iterators for RBSet in most cases --- scene/animation/animation_player.cpp | 10 +++++----- scene/animation/animation_tree.cpp | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'scene/animation') diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 87bfb64917..921a06b73c 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -1766,12 +1766,12 @@ void AnimationPlayer::_animation_changed() { } void AnimationPlayer::_stop_playing_caches() { - for (RBSet::Element *E = playing_caches.front(); E; E = E->next()) { - if (E->get()->node && E->get()->audio_playing) { - E->get()->node->call(SNAME("stop")); + for (TrackNodeCache *E : playing_caches) { + if (E->node && E->audio_playing) { + E->node->call(SNAME("stop")); } - if (E->get()->node && E->get()->animation_playing) { - AnimationPlayer *player = Object::cast_to(E->get()->node); + if (E->node && E->animation_playing) { + AnimationPlayer *player = Object::cast_to(E->node); if (!player) { continue; } diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index 127eeed06f..d34e8db093 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -487,9 +487,9 @@ void AnimationTree::set_active(bool p_active) { } if (!active && is_inside_tree()) { - for (RBSet::Element *E = playing_caches.front(); E; E = E->next()) { - if (ObjectDB::get_instance(E->get()->object_id)) { - E->get()->object->call(SNAME("stop")); + for (const TrackCache *E : playing_caches) { + if (ObjectDB::get_instance(E->object_id)) { + E->object->call(SNAME("stop")); } } -- cgit v1.2.3