diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2021-07-24 15:46:25 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2021-07-25 12:22:25 +0200 |
commit | ac3322b0af8f23e8e2dac8111200bc69b5604c9f (patch) | |
tree | 59a079f13b5c03c2dd3328a26c55f3618e6014f6 /core/io/resource.cpp | |
parent | a0f7f42b842462646281f5c4c9a8db070e034adc (diff) | |
download | redot-engine-ac3322b0af8f23e8e2dac8111200bc69b5604c9f.tar.gz |
Use const references where possible for List range iterators
Diffstat (limited to 'core/io/resource.cpp')
-rw-r--r-- | core/io/resource.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/io/resource.cpp b/core/io/resource.cpp index 695988bd71..727611a573 100644 --- a/core/io/resource.cpp +++ b/core/io/resource.cpp @@ -165,7 +165,7 @@ Error Resource::copy_from(const Ref<Resource> &p_resource) { List<PropertyInfo> pi; p_resource->get_property_list(&pi); - for (PropertyInfo &E : pi) { + for (const PropertyInfo &E : pi) { if (!(E.usage & PROPERTY_USAGE_STORAGE)) { continue; } @@ -201,7 +201,7 @@ Ref<Resource> Resource::duplicate_for_local_scene(Node *p_for_scene, Map<Ref<Res r->local_scene = p_for_scene; - for (PropertyInfo &E : plist) { + for (const PropertyInfo &E : plist) { if (!(E.usage & PROPERTY_USAGE_STORAGE)) { continue; } @@ -233,7 +233,7 @@ void Resource::configure_for_local_scene(Node *p_for_scene, Map<Ref<Resource>, R local_scene = p_for_scene; - for (PropertyInfo &E : plist) { + for (const PropertyInfo &E : plist) { if (!(E.usage & PROPERTY_USAGE_STORAGE)) { continue; } @@ -259,7 +259,7 @@ Ref<Resource> Resource::duplicate(bool p_subresources) const { Ref<Resource> r = (Resource *)ClassDB::instantiate(get_class()); ERR_FAIL_COND_V(r.is_null(), Ref<Resource>()); - for (PropertyInfo &E : plist) { + for (const PropertyInfo &E : plist) { if (!(E.usage & PROPERTY_USAGE_STORAGE)) { continue; } @@ -317,7 +317,7 @@ uint32_t Resource::hash_edited_version() const { List<PropertyInfo> plist; get_property_list(&plist); - for (PropertyInfo &E : plist) { + for (const PropertyInfo &E : plist) { if (E.usage & PROPERTY_USAGE_STORAGE && E.type == Variant::OBJECT && E.hint == PROPERTY_HINT_RESOURCE_TYPE) { RES res = get(E.name); if (res.is_valid()) { |