From 317cd0b19a284f9a7296fcb4e06d9b2362da8c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 6 Feb 2022 14:12:19 +0100 Subject: [PATCH] Refactor some object type checking code with `cast_to` Less stringly typed logic, and less String allocations and comparisons. --- editor/debugger/editor_debugger_node.cpp | 2 +- editor/editor_autoload_settings.cpp | 16 ++--- editor/editor_help_search.cpp | 5 -- editor/editor_inspector.cpp | 2 +- editor/editor_node.cpp | 14 ++--- editor/editor_resource_picker.cpp | 16 ++--- editor/filesystem_dock.cpp | 61 +++++++++---------- .../animation_blend_tree_editor_plugin.cpp | 2 +- editor/plugins/canvas_item_editor_plugin.cpp | 41 +++++++------ editor/plugins/editor_preview_plugins.cpp | 6 +- editor/plugins/node_3d_editor_plugin.cpp | 18 ++---- ...packed_scene_translation_parser_plugin.cpp | 9 +-- .../packed_scene_translation_parser_plugin.h | 4 +- editor/plugins/script_editor_plugin.cpp | 4 +- editor/plugins/script_text_editor.cpp | 2 +- .../plugins/visual_shader_editor_plugin.cpp | 2 +- editor/project_export.cpp | 2 - editor/project_export.h | 2 - main/main.cpp | 19 +++--- .../gdnative/nativescript/nativescript.cpp | 2 +- .../pluginscript/pluginscript_script.cpp | 2 +- modules/gdscript/gdscript_analyzer.cpp | 14 ++--- modules/gdscript/gdscript_editor.cpp | 16 ++--- modules/gdscript/gdscript_parser.cpp | 8 +-- .../gdscript/tests/gdscript_test_runner.cpp | 18 +++--- .../editor/visual_script_editor.cpp | 1 - modules/visual_script/visual_script.cpp | 3 - modules/visual_script/visual_script_nodes.cpp | 10 +-- scene/resources/resource_format_text.cpp | 10 +-- 29 files changed, 140 insertions(+), 171 deletions(-) diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp index 6d9ad9398c3..55add925337 100644 --- a/editor/debugger/editor_debugger_node.cpp +++ b/editor/debugger/editor_debugger_node.cpp @@ -683,7 +683,7 @@ EditorDebuggerNode::CameraOverride EditorDebuggerNode::get_camera_override() { void EditorDebuggerNode::add_debugger_plugin(const Ref