1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00

Do not iterate Dictionary with get_key_at_index.

This commit is contained in:
Yufeng Ying
2025-03-14 03:54:04 +08:00
parent af2c713971
commit bbc380b07e
6 changed files with 27 additions and 27 deletions

View File

@@ -414,10 +414,10 @@ int DebugAdapterProtocol::parse_variant(const Variant &p_var) {
Dictionary dictionary = p_var;
Array arr;
for (int i = 0; i < dictionary.size(); i++) {
for (const KeyValue<Variant, Variant> &kv : dictionary) {
DAP::Variable var;
var.name = dictionary.get_key_at_index(i);
Variant value = dictionary.get_value_at_index(i);
var.name = kv.key;
Variant value = kv.value;
var.type = Variant::get_type_name(value.get_type());
var.value = value;
var.variablesReference = parse_variant(value);