summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_utility_functions.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-09-30 23:52:46 +0200
committerGitHub <noreply@github.com>2021-09-30 23:52:46 +0200
commit77721b35ba21f2e7e8bb42cf415fccb018517843 (patch)
tree96b8f7532ae5d923b75bfbac8d6763015b6646bb /modules/gdscript/gdscript_utility_functions.cpp
parent3e1b6304613855cad56938e8a58848f09363a298 (diff)
parentc63b18507d21b8a213c073bced9057b571cdcd7a (diff)
Merge pull request #51409 from LightningAA/use-map-iterators
Use range iterators for `Map` in most cases
Diffstat (limited to 'modules/gdscript/gdscript_utility_functions.cpp')
-rw-r--r--modules/gdscript/gdscript_utility_functions.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/gdscript/gdscript_utility_functions.cpp b/modules/gdscript/gdscript_utility_functions.cpp
index 62531473c3..f1b0079536 100644
--- a/modules/gdscript/gdscript_utility_functions.cpp
+++ b/modules/gdscript/gdscript_utility_functions.cpp
@@ -317,9 +317,9 @@ struct GDScriptUtilityFunctionsDefinitions {
d["@subpath"] = cp;
d["@path"] = p->get_path();
- for (Map<StringName, GDScript::MemberInfo>::Element *E = base->member_indices.front(); E; E = E->next()) {
- if (!d.has(E->key())) {
- d[E->key()] = ins->members[E->get().index];
+ for (const KeyValue<StringName, GDScript::MemberInfo> &E : base->member_indices) {
+ if (!d.has(E.key)) {
+ d[E.key] = ins->members[E.value.index];
}
}
*r_ret = d;
@@ -396,9 +396,9 @@ struct GDScriptUtilityFunctionsDefinitions {
GDScriptInstance *ins = static_cast<GDScriptInstance *>(static_cast<Object *>(*r_ret)->get_script_instance());
Ref<GDScript> gd_ref = ins->get_script();
- for (Map<StringName, GDScript::MemberInfo>::Element *E = gd_ref->member_indices.front(); E; E = E->next()) {
- if (d.has(E->key())) {
- ins->members.write[E->get().index] = d[E->key()];
+ for (KeyValue<StringName, GDScript::MemberInfo> &E : gd_ref->member_indices) {
+ if (d.has(E.key)) {
+ ins->members.write[E.value.index] = d[E.key];
}
}
}