From 746dddc0673d7261f19b1e056e90e6e3a49ef33a Mon Sep 17 00:00:00 2001 From: reduz Date: Fri, 13 May 2022 15:04:37 +0200 Subject: Replace most uses of Map by HashMap * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated! --- modules/gdscript/gdscript_parser.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'modules/gdscript/gdscript_parser.h') diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index 857e06440c..17f87edeeb 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -39,7 +39,7 @@ #include "core/string/ustring.h" #include "core/templates/hash_map.h" #include "core/templates/list.h" -#include "core/templates/map.h" +#include "core/templates/rb_map.h" #include "core/templates/vector.h" #include "core/variant/variant.h" #include "gdscript_cache.h" @@ -802,7 +802,7 @@ public: FunctionNode *function = nullptr; FunctionNode *parent_function = nullptr; Vector captures; - Map captures_indices; + HashMap captures_indices; bool use_self = false; bool has_name() const { @@ -1205,9 +1205,9 @@ private: List errors; #ifdef DEBUG_ENABLED List warnings; - Set ignored_warnings; - Set ignored_warning_codes; - Set unsafe_lines; + RBSet ignored_warnings; + RBSet ignored_warning_codes; + RBSet unsafe_lines; #endif GDScriptTokenizer tokenizer; @@ -1419,7 +1419,7 @@ public: } #ifdef DEBUG_ENABLED const List &get_warnings() const { return warnings; } - const Set &get_unsafe_lines() const { return unsafe_lines; } + const RBSet &get_unsafe_lines() const { return unsafe_lines; } int get_last_line_number() const { return current.end_line; } #endif -- cgit v1.2.3