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

@ -407,9 +407,9 @@ void EditorPropertyOTVariation::update_property() {
Dictionary supported = (fd.is_valid()) ? fd->get_supported_variation_list() : Dictionary();
for (int i = 0; i < supported.size(); i++) {
int name_tag = supported.get_key_at_index(i);
Vector3i range = supported.get_value_at_index(i);
for (const KeyValue<Variant, Variant> &kv : supported) {
const int &name_tag = kv.key;
const Vector3i &range = kv.value;
if ((dict.has(name_tag) && dict[name_tag].get_type() == Variant::NIL) || !dict.has(name_tag)) {
dict[name_tag] = range.z;
}