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

@ -922,12 +922,9 @@ Variant JSON::_from_native(const Variant &p_variant, bool p_full_objects, int p_
ERR_FAIL_COND_V_MSG(p_depth > Variant::MAX_RECURSION_DEPTH, ret, "Variant is too deep. Bailing.");
List<Variant> keys;
dict.get_key_list(&keys);
for (const Variant &key : keys) {
args.push_back(_from_native(key, p_full_objects, p_depth + 1));
args.push_back(_from_native(dict[key], p_full_objects, p_depth + 1));
for (const KeyValue<Variant, Variant> &kv : dict) {
args.push_back(_from_native(kv.key, p_full_objects, p_depth + 1));
args.push_back(_from_native(kv.value, p_full_objects, p_depth + 1));
}
return ret;