From 900c676b0282bed83d00834e3c280ac89c2bc94d Mon Sep 17 00:00:00 2001 From: Aaron Record Date: Wed, 18 May 2022 17:43:40 -0600 Subject: Use range iterators for RBSet in most cases --- editor/animation_bezier_editor.cpp | 8 +- editor/create_dialog.cpp | 4 +- editor/debugger/editor_debugger_inspector.cpp | 4 +- editor/debugger/editor_debugger_node.cpp | 4 +- editor/debugger/editor_profiler.cpp | 24 ++--- editor/editor_asset_installer.cpp | 6 +- editor/editor_export.cpp | 14 +-- editor/editor_feature_profile.cpp | 12 +-- editor/editor_file_system.cpp | 4 +- editor/editor_folding.cpp | 8 +- editor/editor_node.cpp | 34 +++--- editor/editor_resource_picker.cpp | 16 +-- editor/editor_settings.cpp | 14 +-- editor/editor_translation_parser.cpp | 4 +- editor/import/editor_import_collada.cpp | 14 +-- .../plugins/animation_blend_tree_editor_plugin.cpp | 4 +- editor/plugins/node_3d_editor_plugin.cpp | 8 +- editor/plugins/root_motion_editor_plugin.cpp | 4 +- editor/plugins/script_text_editor.cpp | 4 +- editor/plugins/sprite_frames_editor_plugin.cpp | 8 +- editor/plugins/tiles/tile_data_editors.cpp | 30 +++--- editor/plugins/tiles/tile_map_editor.cpp | 86 ++++++++-------- .../plugins/tiles/tile_set_atlas_source_editor.cpp | 114 ++++++++++----------- editor/plugins/visual_shader_editor_plugin.cpp | 4 +- editor/pot_generator.cpp | 8 +- editor/project_manager.cpp | 12 +-- editor/project_settings_editor.cpp | 4 +- editor/property_editor.cpp | 8 +- 28 files changed, 232 insertions(+), 232 deletions(-) (limited to 'editor') diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index ff8b72274c..c5f800b17a 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -747,8 +747,8 @@ void AnimationBezierTrackEdit::_update_locked_tracks_after(int p_track) { } Vector updated_locked_tracks; - for (RBSet::Element *E = locked_tracks.front(); E; E = E->next()) { - updated_locked_tracks.push_back(E->get()); + for (const int &E : locked_tracks) { + updated_locked_tracks.push_back(E); } locked_tracks.clear(); for (int i = 0; i < updated_locked_tracks.size(); ++i) { @@ -766,8 +766,8 @@ void AnimationBezierTrackEdit::_update_hidden_tracks_after(int p_track) { } Vector updated_hidden_tracks; - for (RBSet::Element *E = hidden_tracks.front(); E; E = E->next()) { - updated_hidden_tracks.push_back(E->get()); + for (const int &E : hidden_tracks) { + updated_hidden_tracks.push_back(E); } hidden_tracks.clear(); for (int i = 0; i < updated_hidden_tracks.size(); ++i) { diff --git a/editor/create_dialog.cpp b/editor/create_dialog.cpp index fb908ea573..3469e96a0a 100644 --- a/editor/create_dialog.cpp +++ b/editor/create_dialog.cpp @@ -138,8 +138,8 @@ bool CreateDialog::_should_hide_type(const String &p_type) const { return true; // Wrong inheritance. } - for (RBSet::Element *E = type_blacklist.front(); E; E = E->next()) { - if (ClassDB::is_parent_class(p_type, E->get())) { + for (const StringName &E : type_blacklist) { + if (ClassDB::is_parent_class(p_type, E)) { return true; // Parent type is blacklisted. } } diff --git a/editor/debugger/editor_debugger_inspector.cpp b/editor/debugger/editor_debugger_inspector.cpp index 6d7f3f4ae2..0dd7b44b68 100644 --- a/editor/debugger/editor_debugger_inspector.cpp +++ b/editor/debugger/editor_debugger_inspector.cpp @@ -193,8 +193,8 @@ ObjectID EditorDebuggerInspector::add_object(const Array &p_arr) { if (old_prop_size == debugObj->prop_list.size() && new_props_added == 0) { //only some may have changed, if so, then update those, if exist - for (RBSet::Element *E = changed.front(); E; E = E->next()) { - emit_signal(SNAME("object_property_updated"), debugObj->remote_object_id, E->get()); + for (const String &E : changed) { + emit_signal(SNAME("object_property_updated"), debugObj->remote_object_id, E); } } else { //full update, because props were added or removed diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index de26b56ab6..bc28b11a71 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -118,8 +118,8 @@ ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() { } if (!debugger_plugins.is_empty()) { - for (RBSet>::Element *i = debugger_plugins.front(); i; i = i->next()) { - node->add_debugger_plugin(i->get()); + for (const Ref