From 45af29da8095af16729955117a165d23e77cd740 Mon Sep 17 00:00:00 2001 From: reduz Date: Thu, 19 May 2022 17:00:06 +0200 Subject: Add a new HashSet template * Intended to replace RBSet in most cases. * Optimized for iteration speed --- .../editor/gdscript_translation_parser_plugin.h | 8 ++++---- modules/gdscript/gdscript.cpp | 8 ++++---- modules/gdscript/gdscript.h | 13 +++++++------ modules/gdscript/gdscript_analyzer.cpp | 6 +++--- modules/gdscript/gdscript_analyzer.h | 2 +- modules/gdscript/gdscript_cache.cpp | 6 +++--- modules/gdscript/gdscript_cache.h | 4 ++-- modules/gdscript/gdscript_compiler.h | 6 +++--- modules/gdscript/gdscript_editor.cpp | 4 ++-- modules/gdscript/gdscript_parser.h | 8 ++++---- modules/gdscript/gdscript_tokenizer.h | 2 +- .../gdscript/language_server/gdscript_workspace.cpp | 2 +- modules/gdscript/register_types.cpp | 2 +- modules/gltf/gltf_document.h | 10 +++++----- modules/gltf/gltf_skeleton.h | 2 +- modules/gltf/gltf_state.h | 4 ++-- modules/gridmap/grid_map.h | 2 +- modules/mono/csharp_script.cpp | 18 +++++++++--------- modules/mono/csharp_script.h | 12 ++++++------ modules/raycast/lightmap_raycaster.cpp | 2 +- modules/raycast/lightmap_raycaster.h | 4 ++-- modules/raycast/raycast_occlusion_cull.h | 16 +++++++++------- modules/raycast/static_raycaster.cpp | 2 +- modules/raycast/static_raycaster.h | 4 ++-- modules/text_server_adv/text_server_adv.cpp | 2 +- modules/text_server_adv/text_server_adv.h | 4 ++-- modules/visual_script/visual_script.cpp | 2 +- modules/visual_script/visual_script.h | 3 ++- 28 files changed, 81 insertions(+), 77 deletions(-) (limited to 'modules') diff --git a/modules/gdscript/editor/gdscript_translation_parser_plugin.h b/modules/gdscript/editor/gdscript_translation_parser_plugin.h index 4633a431d8..969a50f48c 100644 --- a/modules/gdscript/editor/gdscript_translation_parser_plugin.h +++ b/modules/gdscript/editor/gdscript_translation_parser_plugin.h @@ -31,7 +31,7 @@ #ifndef GDSCRIPT_TRANSLATION_PARSER_PLUGIN_H #define GDSCRIPT_TRANSLATION_PARSER_PLUGIN_H -#include "core/templates/rb_set.h" +#include "core/templates/hash_set.h" #include "editor/editor_translation_parser.h" #include "modules/gdscript/gdscript_parser.h" @@ -44,9 +44,9 @@ class GDScriptEditorTranslationParserPlugin : public EditorTranslationParserPlug // List of patterns used for extracting translation strings. StringName tr_func = "tr"; StringName trn_func = "tr_n"; - RBSet assignment_patterns; - RBSet first_arg_patterns; - RBSet second_arg_patterns; + HashSet assignment_patterns; + HashSet first_arg_patterns; + HashSet second_arg_patterns; // FileDialog patterns. StringName fd_add_filter = "add_filter"; StringName fd_set_filter = "set_filters"; diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 25f4823d92..066b772227 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -788,7 +788,7 @@ void GDScript::update_exports() { return; } - RBSet copy = inheriters_cache; //might get modified + HashSet copy = inheriters_cache; //might get modified for (const ObjectID &E : copy) { Object *id = ObjectDB::get_instance(E); @@ -937,7 +937,7 @@ void GDScript::get_constants(HashMap *p_constants) { } } -void GDScript::get_members(RBSet *p_members) { +void GDScript::get_members(HashSet *p_members) { if (p_members) { for (const StringName &E : members) { p_members->insert(E); @@ -1916,7 +1916,7 @@ void GDScriptLanguage::reload_tool_script(const Ref