From 4e6efd1b07f1c6d53d226977ddc729333b74306a Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Thu, 15 Jul 2021 23:45:57 -0400 Subject: Use C++ iterators for Lists in many situations --- editor/project_settings_editor.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'editor/project_settings_editor.cpp') diff --git a/editor/project_settings_editor.cpp b/editor/project_settings_editor.cpp index 2c4b28e13d..bc44fccfa0 100644 --- a/editor/project_settings_editor.cpp +++ b/editor/project_settings_editor.cpp @@ -229,16 +229,16 @@ void ProjectSettingsEditor::_add_feature_overrides() { for (int i = 0; i < ee->get_export_platform_count(); i++) { List p; ee->get_export_platform(i)->get_platform_features(&p); - for (List::Element *E = p.front(); E; E = E->next()) { - presets.insert(E->get()); + for (String &E : p) { + presets.insert(E); } } for (int i = 0; i < ee->get_export_preset_count(); i++) { List p; ee->get_export_preset(i)->get_platform()->get_preset_features(ee->get_export_preset(i), &p); - for (List::Element *E = p.front(); E; E = E->next()) { - presets.insert(E->get()); + for (String &E : p) { + presets.insert(E); } String custom = ee->get_export_preset(i)->get_custom_features(); @@ -391,8 +391,7 @@ void ProjectSettingsEditor::_action_reordered(const String &p_action_name, const undo_redo->create_action(TTR("Update Input Action Order")); - for (List::Element *E = props.front(); E; E = E->next()) { - PropertyInfo prop = E->get(); + for (PropertyInfo &prop : props) { // Skip builtins and non-inputs if (ProjectSettings::get_singleton()->is_builtin_setting(prop.name) || !prop.name.begins_with("input/")) { continue; @@ -445,8 +444,8 @@ void ProjectSettingsEditor::_update_action_map_editor() { ProjectSettings::get_singleton()->get_property_list(&props); const Ref builtin_icon = get_theme_icon(SNAME("PinPressed"), SNAME("EditorIcons")); - for (List::Element *E = props.front(); E; E = E->next()) { - const String property_name = E->get().name; + for (PropertyInfo &E : props) { + const String property_name = E.name; if (!property_name.begins_with("input/")) { continue; -- cgit v1.2.3