diff options
author | reduz <reduzio@gmail.com> | 2022-05-13 15:04:37 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-05-16 10:37:48 +0200 |
commit | 746dddc0673d7261f19b1e056e90e6e3a49ef33a (patch) | |
tree | 434b526eb286850ebccc6d2c998a7d90fdb8b5e2 /editor/editor_node.h | |
parent | 396def9b66c476f7834604adb7136ca903ed01be (diff) | |
download | redot-engine-746dddc0673d7261f19b1e056e90e6e3a49ef33a.tar.gz |
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!
Diffstat (limited to 'editor/editor_node.h')
-rw-r--r-- | editor/editor_node.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/editor/editor_node.h b/editor/editor_node.h index 0d154123b3..9cd96050e3 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -273,7 +273,7 @@ private: Vector<EditorPlugin *> editor_plugins; bool _initializing_plugins = false; - Map<String, EditorPlugin *> addon_name_to_plugin; + HashMap<String, EditorPlugin *> addon_name_to_plugin; PanelContainer *scene_root_parent = nullptr; Control *theme_base = nullptr; @@ -394,7 +394,7 @@ private: BackgroundProgress *progress_hb = nullptr; DependencyErrorDialog *dependency_error = nullptr; - Map<String, Set<String>> dependency_errors; + HashMap<String, RBSet<String>> dependency_errors; DependencyEditor *dependency_fixer = nullptr; OrphanResourcesDialog *orphan_resources = nullptr; ConfirmationDialog *open_imported = nullptr; @@ -470,15 +470,15 @@ private: String import_reload_fn; - Set<String> textfile_extensions; - Set<FileDialog *> file_dialogs; - Set<EditorFileDialog *> editor_file_dialogs; + RBSet<String> textfile_extensions; + RBSet<FileDialog *> file_dialogs; + RBSet<EditorFileDialog *> editor_file_dialogs; Vector<Ref<EditorResourceConversionPlugin>> resource_conversion_plugins; PrintHandlerList print_handler; - Map<String, Ref<Texture2D>> icon_type_cache; - Map<Ref<Script>, Ref<Texture>> script_icon_cache; + HashMap<String, Ref<Texture2D>> icon_type_cache; + HashMap<Ref<Script>, Ref<Texture>> script_icon_cache; static EditorBuildCallback build_callbacks[MAX_BUILD_CALLBACKS]; static EditorPluginInitializeCallback plugin_init_callbacks[MAX_INIT_CALLBACKS]; @@ -489,7 +489,7 @@ private: static void _dependency_error_report(void *ud, const String &p_path, const String &p_dep, const String &p_type) { EditorNode *en = static_cast<EditorNode *>(ud); if (!en->dependency_errors.has(p_path)) { - en->dependency_errors[p_path] = Set<String>(); + en->dependency_errors[p_path] = RBSet<String>(); } en->dependency_errors[p_path].insert(p_dep + "::" + p_type); } @@ -594,9 +594,9 @@ private: void _remove_edited_scene(bool p_change_tab = true); void _remove_scene(int index, bool p_change_tab = true); - bool _find_and_save_resource(Ref<Resource> p_res, Map<Ref<Resource>, bool> &processed, int32_t flags); - bool _find_and_save_edited_subresources(Object *obj, Map<Ref<Resource>, bool> &processed, int32_t flags); - void _save_edited_subresources(Node *scene, Map<Ref<Resource>, bool> &processed, int32_t flags); + bool _find_and_save_resource(Ref<Resource> p_res, HashMap<Ref<Resource>, bool> &processed, int32_t flags); + bool _find_and_save_edited_subresources(Object *obj, HashMap<Ref<Resource>, bool> &processed, int32_t flags); + void _save_edited_subresources(Node *scene, HashMap<Ref<Resource>, bool> &processed, int32_t flags); void _mark_unsaved_scenes(); void _find_node_types(Node *p_node, int &count_2d, int &count_3d); |