You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
[Core] Add iteration support to Array
This commit is contained in:
@@ -1844,8 +1844,8 @@ void ResourceFormatSaverBinaryInstance::write_variant(Ref<FileAccess> f, const V
|
||||
f->store_32(VARIANT_ARRAY);
|
||||
Array a = p_property;
|
||||
f->store_32(uint32_t(a.size()));
|
||||
for (int i = 0; i < a.size(); i++) {
|
||||
write_variant(f, a[i], resource_map, external_resources, string_map);
|
||||
for (const Variant &var : a) {
|
||||
write_variant(f, var, resource_map, external_resources, string_map);
|
||||
}
|
||||
|
||||
} break;
|
||||
@@ -2017,9 +2017,7 @@ void ResourceFormatSaverBinaryInstance::_find_resources(const Variant &p_variant
|
||||
case Variant::ARRAY: {
|
||||
Array varray = p_variant;
|
||||
_find_resources(varray.get_typed_script());
|
||||
int len = varray.size();
|
||||
for (int i = 0; i < len; i++) {
|
||||
const Variant &v = varray.get(i);
|
||||
for (const Variant &v : varray) {
|
||||
_find_resources(v);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user