summaryrefslogtreecommitdiff
path: root/core
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 /core
parenta504e4d4c3af53bb21a0013132719affd3e21798 (diff)
parent92299989bd10fd9855b6d77bc2bfabae218d1eea (diff)
Merge pull request #50899 from akien-mga/refref
Use Ref<T> references as iterators where relevant
Diffstat (limited to 'core')
-rw-r--r--core/core_bind.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/core/core_bind.cpp b/core/core_bind.cpp
index 12fca4215a..9e96d4b079 100644
--- a/core/core_bind.cpp
+++ b/core/core_bind.cpp
@@ -355,20 +355,20 @@ void _OS::print_all_textures_by_size() {
List<Ref<Resource>> rsrc;
ResourceCache::get_cached_resources(&rsrc);
- for (Ref<Resource> E : rsrc) {
- if (!E->is_class("ImageTexture")) {
+ for (Ref<Resource> &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<String> &p_types) {
List<Ref<Resource>> resources;
ResourceCache::get_cached_resources(&resources);
- for (Ref<Resource> r : resources) {
+ for (const Ref<Resource> &r : resources) {
bool found = false;
for (int i = 0; i < p_types.size(); i++) {