mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Merge pull request #104047 from YYF233333/dict_iter
Add const iteration support to `Dictionary`
This commit is contained in:
commit
22a7079afd
34 changed files with 131 additions and 179 deletions
|
|
@ -1593,10 +1593,8 @@ void EditorNode::_save_editor_states(const String &p_file, int p_idx) {
|
|||
md = editor_data.get_scene_editor_states(p_idx);
|
||||
}
|
||||
|
||||
List<Variant> keys;
|
||||
md.get_key_list(&keys);
|
||||
for (const Variant &E : keys) {
|
||||
cf->set_value("editor_states", E, md[E]);
|
||||
for (const KeyValue<Variant, Variant> &kv : md) {
|
||||
cf->set_value("editor_states", kv.key, kv.value);
|
||||
}
|
||||
|
||||
// Save the currently selected nodes.
|
||||
|
|
@ -1670,11 +1668,8 @@ bool EditorNode::_find_and_save_edited_subresources(Object *obj, HashMap<Ref<Res
|
|||
} break;
|
||||
case Variant::DICTIONARY: {
|
||||
Dictionary d = obj->get(E.name);
|
||||
List<Variant> keys;
|
||||
d.get_key_list(&keys);
|
||||
for (const Variant &F : keys) {
|
||||
Variant v = d[F];
|
||||
Ref<Resource> res = v;
|
||||
for (const KeyValue<Variant, Variant> &kv : d) {
|
||||
Ref<Resource> res = kv.value;
|
||||
if (_find_and_save_resource(res, processed, flags)) {
|
||||
ret_changed = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue