1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-28 16:07:14 +00:00

Add ConstIterator to Dictionary.

This commit is contained in:
Yufeng Ying
2025-03-12 06:43:48 +08:00
parent 74907876d3
commit bebe037abf
34 changed files with 131 additions and 179 deletions

View File

@@ -1587,10 +1587,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.
@@ -1664,11 +1662,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;
}