From ac3322b0af8f23e8e2dac8111200bc69b5604c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sat, 24 Jul 2021 15:46:25 +0200 Subject: Use const references where possible for List range iterators --- scene/animation/animation_player.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scene/animation/animation_player.cpp') diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index 0f557519b2..67b6205a65 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -176,7 +176,7 @@ void AnimationPlayer::_get_property_list(List *p_list) const { anim_names.sort(); - for (PropertyInfo &E : anim_names) { + for (const PropertyInfo &E : anim_names) { p_list->push_back(E); } @@ -1076,7 +1076,7 @@ void AnimationPlayer::get_animation_list(List *p_animations) const { anims.sort(); - for (String &E : anims) { + for (const String &E : anims) { p_animations->push_back(E); } } @@ -1118,7 +1118,7 @@ void AnimationPlayer::queue(const StringName &p_name) { Vector AnimationPlayer::get_queue() { Vector ret; - for (StringName &E : queued) { + for (const StringName &E : queued) { ret.push_back(E); } @@ -1502,7 +1502,7 @@ void AnimationPlayer::get_argument_options(const StringName &p_function, int p_i if (p_idx == 0 && (p_function == "play" || p_function == "play_backwards" || p_function == "remove_animation" || p_function == "has_animation" || p_function == "queue")) { List al; get_animation_list(&al); - for (StringName &E : al) { + for (const StringName &E : al) { r_options->push_back(quote_style + String(E) + quote_style); } } -- cgit v1.2.3