You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
Use C++ iterators for Lists in many situations
This commit is contained in:
@@ -1586,8 +1586,8 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
|
||||
List<PropertyInfo> props;
|
||||
obj->get_property_list(&props);
|
||||
bool first = true;
|
||||
for (List<PropertyInfo>::Element *E = props.front(); E; E = E->next()) {
|
||||
if (E->get().usage & PROPERTY_USAGE_STORAGE || E->get().usage & PROPERTY_USAGE_SCRIPT_VARIABLE) {
|
||||
for (PropertyInfo &E : props) {
|
||||
if (E.usage & PROPERTY_USAGE_STORAGE || E.usage & PROPERTY_USAGE_SCRIPT_VARIABLE) {
|
||||
//must be serialized
|
||||
|
||||
if (first) {
|
||||
@@ -1596,8 +1596,8 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
|
||||
p_store_string_func(p_store_string_ud, ",");
|
||||
}
|
||||
|
||||
p_store_string_func(p_store_string_ud, "\"" + E->get().name + "\":");
|
||||
write(obj->get(E->get().name), p_store_string_func, p_store_string_ud, p_encode_res_func, p_encode_res_ud);
|
||||
p_store_string_func(p_store_string_ud, "\"" + E.name + "\":");
|
||||
write(obj->get(E.name), p_store_string_func, p_store_string_ud, p_encode_res_func, p_encode_res_ud);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1615,7 +1615,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
|
||||
p_store_string_func(p_store_string_ud, "{\n");
|
||||
for (List<Variant>::Element *E = keys.front(); E; E = E->next()) {
|
||||
/*
|
||||
if (!_check_type(dict[E->get()]))
|
||||
if (!_check_type(dict[E]))
|
||||
continue;
|
||||
*/
|
||||
write(E->get(), p_store_string_func, p_store_string_ud, p_encode_res_func, p_encode_res_ud);
|
||||
|
||||
Reference in New Issue
Block a user