summaryrefslogtreecommitdiff
path: root/scene/main/instance_placeholder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/main/instance_placeholder.cpp')
-rw-r--r--scene/main/instance_placeholder.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp
index 89dac5f5a8..b7c6723cfc 100644
--- a/scene/main/instance_placeholder.cpp
+++ b/scene/main/instance_placeholder.cpp
@@ -42,9 +42,9 @@ bool InstancePlaceholder::_set(const StringName &p_name, const Variant &p_value)
}
bool InstancePlaceholder::_get(const StringName &p_name, Variant &r_ret) const {
- for (const List<PropSet>::Element *E = stored_values.front(); E; E = E->next()) {
- if (E->get().name == p_name) {
- r_ret = E->get().value;
+ for (const PropSet &E : stored_values) {
+ if (E.name == p_name) {
+ r_ret = E.value;
return true;
}
}
@@ -52,10 +52,10 @@ bool InstancePlaceholder::_get(const StringName &p_name, Variant &r_ret) const {
}
void InstancePlaceholder::_get_property_list(List<PropertyInfo> *p_list) const {
- for (const List<PropSet>::Element *E = stored_values.front(); E; E = E->next()) {
+ for (const PropSet &E : stored_values) {
PropertyInfo pi;
- pi.name = E->get().name;
- pi.type = E->get().value.get_type();
+ pi.name = E.name;
+ pi.type = E.value.get_type();
pi.usage = PROPERTY_USAGE_STORAGE;
p_list->push_back(pi);
@@ -95,8 +95,8 @@ Node *InstancePlaceholder::create_instance(bool p_replace, const Ref<PackedScene
scene->set_name(get_name());
int pos = get_index();
- for (List<PropSet>::Element *E = stored_values.front(); E; E = E->next()) {
- scene->set(E->get().name, E->get().value);
+ for (PropSet &E : stored_values) {
+ scene->set(E.name, E.value);
}
if (p_replace) {
@@ -114,10 +114,10 @@ Dictionary InstancePlaceholder::get_stored_values(bool p_with_order) {
Dictionary ret;
PackedStringArray order;
- for (List<PropSet>::Element *E = stored_values.front(); E; E = E->next()) {
- ret[E->get().name] = E->get().value;
+ for (PropSet &E : stored_values) {
+ ret[E.name] = E.value;
if (p_with_order) {
- order.push_back(E->get().name);
+ order.push_back(E.name);
}
};