diff --git a/core/core_bind.cpp b/core/core_bind.cpp index 12fca4215ac..9e96d4b0794 100644 --- a/core/core_bind.cpp +++ b/core/core_bind.cpp @@ -355,20 +355,20 @@ void _OS::print_all_textures_by_size() { List> rsrc; ResourceCache::get_cached_resources(&rsrc); - for (Ref E : rsrc) { - if (!E->is_class("ImageTexture")) { + for (Ref &res : rsrc) { + if (!res->is_class("ImageTexture")) { continue; } - Size2 size = E->call("get_size"); - int fmt = E->call("get_format"); + Size2 size = res->call("get_size"); + int fmt = res->call("get_format"); _OSCoreBindImg img; img.size = size; img.fmt = fmt; - img.path = E->get_path(); + img.path = res->get_path(); img.vram = Image::get_image_data_size(img.size.width, img.size.height, Image::Format(img.fmt)); - img.id = E->get_instance_id(); + img.id = res->get_instance_id(); total += img.vram; imgs.push_back(img); } @@ -387,7 +387,7 @@ void _OS::print_resources_by_type(const Vector &p_types) { List> resources; ResourceCache::get_cached_resources(&resources); - for (Ref r : resources) { + for (const Ref &r : resources) { bool found = false; for (int i = 0; i < p_types.size(); i++) { diff --git a/editor/editor_inspector.cpp b/editor/editor_inspector.cpp index cdbe505441e..3db03c02761 100644 --- a/editor/editor_inspector.cpp +++ b/editor/editor_inspector.cpp @@ -1648,7 +1648,7 @@ void EditorInspector::update_tree() { Color sscolor = get_theme_color(SNAME("prop_subsection"), SNAME("Editor")); - for (Ref ped : valid_plugins) { + for (Ref &ped : valid_plugins) { ped->parse_begin(object); _parse_added_editors(main_vbox, ped); } @@ -1745,7 +1745,7 @@ void EditorInspector::update_tree() { category->set_tooltip(p.name + "::" + (class_descr_cache[type2] == "" ? "" : class_descr_cache[type2])); } - for (Ref ped : valid_plugins) { + for (Ref &ped : valid_plugins) { ped->parse_category(object, p.name); _parse_added_editors(main_vbox, ped); } @@ -1946,7 +1946,7 @@ void EditorInspector::update_tree() { doc_hint = descr; } - for (Ref ped : valid_plugins) { + for (Ref &ped : valid_plugins) { bool exclusive = ped->parse_property(object, p.type, p.name, p.hint, p.hint_string, p.usage, wide_editors); List editors = ped->added_editors; //make a copy, since plugins may be used again in a sub-inspector @@ -2028,7 +2028,7 @@ void EditorInspector::update_tree() { } } - for (Ref ped : valid_plugins) { + for (Ref &ped : valid_plugins) { ped->parse_end(); _parse_added_editors(main_vbox, ped); } @@ -2595,7 +2595,7 @@ void EditorInspector::_update_script_class_properties(const Object &p_object, Li } Set added; - for (Ref