You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Use C++ iterators for Lists in many situations
This commit is contained in:
@@ -700,9 +700,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
|
||||
int count = 0;
|
||||
|
||||
for (Map<String, List<String>>::Element *E = props.front(); E; E = E->next()) {
|
||||
for (List<String>::Element *F = E->get().front(); F; F = F->next()) {
|
||||
count++;
|
||||
}
|
||||
count += E->get().size();
|
||||
}
|
||||
|
||||
if (p_custom_features != String()) {
|
||||
@@ -734,8 +732,7 @@ Error ProjectSettings::_save_settings_binary(const String &p_file, const Map<Str
|
||||
}
|
||||
|
||||
for (Map<String, List<String>>::Element *E = props.front(); E; E = E->next()) {
|
||||
for (List<String>::Element *F = E->get().front(); F; F = F->next()) {
|
||||
String key = F->get();
|
||||
for (String &key : E->get()) {
|
||||
if (E->key() != "") {
|
||||
key = E->key() + "/" + key;
|
||||
}
|
||||
@@ -803,8 +800,8 @@ Error ProjectSettings::_save_settings_text(const String &p_file, const Map<Strin
|
||||
if (E->key() != "") {
|
||||
file->store_string("[" + E->key() + "]\n\n");
|
||||
}
|
||||
for (List<String>::Element *F = E->get().front(); F; F = F->next()) {
|
||||
String key = F->get();
|
||||
for (String &F : E->get()) {
|
||||
String key = F;
|
||||
if (E->key() != "") {
|
||||
key = E->key() + "/" + key;
|
||||
}
|
||||
@@ -817,7 +814,7 @@ Error ProjectSettings::_save_settings_text(const String &p_file, const Map<Strin
|
||||
|
||||
String vstr;
|
||||
VariantWriter::write_to_string(value, vstr);
|
||||
file->store_string(F->get().property_name_encode() + "=" + vstr + "\n");
|
||||
file->store_string(F.property_name_encode() + "=" + vstr + "\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -931,11 +928,11 @@ Vector<String> ProjectSettings::get_optimizer_presets() const {
|
||||
ProjectSettings::get_singleton()->get_property_list(&pi);
|
||||
Vector<String> names;
|
||||
|
||||
for (List<PropertyInfo>::Element *E = pi.front(); E; E = E->next()) {
|
||||
if (!E->get().name.begins_with("optimizer_presets/")) {
|
||||
for (PropertyInfo &E : pi) {
|
||||
if (!E.name.begins_with("optimizer_presets/")) {
|
||||
continue;
|
||||
}
|
||||
names.push_back(E->get().name.get_slicec('/', 1));
|
||||
names.push_back(E.name.get_slicec('/', 1));
|
||||
}
|
||||
|
||||
names.sort();
|
||||
|
||||
Reference in New Issue
Block a user