Use const references where possible for List range iterators

This commit is contained in:
Rémi Verschelde 2021-07-24 15:46:25 +02:00
parent a0f7f42b84
commit ac3322b0af
No known key found for this signature in database
GPG key ID: C3336907360768E1
171 changed files with 649 additions and 650 deletions

View file

@ -350,7 +350,7 @@ void AnimationPlayerEditor::_animation_load() {
List<String> extensions;
ResourceLoader::get_recognized_extensions_for_type("Animation", &extensions);
for (String &E : extensions) {
for (const String &E : extensions) {
file->add_filter("*." + E + " ; " + E.to_upper());
}
@ -584,7 +584,7 @@ void AnimationPlayerEditor::_animation_blend() {
blend_editor.next->clear();
blend_editor.next->add_item("", i);
for (StringName &to : anims) {
for (const StringName &to : anims) {
TreeItem *blend = blend_editor.tree->create_item(root);
blend->set_editable(0, false);
blend->set_editable(1, true);
@ -829,7 +829,7 @@ void AnimationPlayerEditor::_update_player() {
}
int active_idx = -1;
for (StringName &E : animlist) {
for (const StringName &E : animlist) {
Ref<Texture2D> icon;
if (E == player->get_autoplay()) {
if (E == "RESET") {
@ -965,7 +965,7 @@ void AnimationPlayerEditor::_animation_duplicate() {
Ref<Animation> new_anim = memnew(Animation);
List<PropertyInfo> plist;
anim->get_property_list(&plist);
for (PropertyInfo &E : plist) {
for (const PropertyInfo &E : plist) {
if (E.usage & PROPERTY_USAGE_STORAGE) {
new_anim->set(E.name, anim->get(E.name));
}