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/editor_folding.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'editor/editor_folding.cpp') diff --git a/editor/editor_folding.cpp b/editor/editor_folding.cpp index ad8aaf324c..9e1b361f64 100644 --- a/editor/editor_folding.cpp +++ b/editor/editor_folding.cpp @@ -87,7 +87,7 @@ void EditorFolding::load_resource_folding(Ref p_resource, const String _set_unfolds(p_resource.ptr(), unfolds); } -void EditorFolding::_fill_folds(const Node *p_root, const Node *p_node, Array &p_folds, Array &resource_folds, Array &nodes_folded, RBSet> &resources) { +void EditorFolding::_fill_folds(const Node *p_root, const Node *p_node, Array &p_folds, Array &resource_folds, Array &nodes_folded, HashSet> &resources) { if (p_root != p_node) { if (!p_node->get_owner()) { return; //not owned, bye @@ -140,7 +140,7 @@ void EditorFolding::save_scene_folding(const Node *p_scene, const String &p_path config.instantiate(); Array unfolds, res_unfolds; - RBSet> resources; + HashSet> resources; Array nodes_folded; _fill_folds(p_scene, p_scene, unfolds, res_unfolds, nodes_folded, resources); @@ -220,13 +220,13 @@ bool EditorFolding::has_folding_data(const String &p_path) { return FileAccess::exists(file); } -void EditorFolding::_do_object_unfolds(Object *p_object, RBSet> &resources) { +void EditorFolding::_do_object_unfolds(Object *p_object, HashSet> &resources) { List plist; p_object->get_property_list(&plist); String group_base; String group; - RBSet unfold_group; + HashSet unfold_group; for (const PropertyInfo &E : plist) { if (E.usage & PROPERTY_USAGE_CATEGORY) { @@ -275,7 +275,7 @@ void EditorFolding::_do_object_unfolds(Object *p_object, RBSet> &r } } -void EditorFolding::_do_node_unfolds(Node *p_root, Node *p_node, RBSet> &resources) { +void EditorFolding::_do_node_unfolds(Node *p_root, Node *p_node, HashSet> &resources) { if (p_root != p_node) { if (!p_node->get_owner()) { return; //not owned, bye @@ -293,7 +293,7 @@ void EditorFolding::_do_node_unfolds(Node *p_root, Node *p_node, RBSet> resources; + HashSet> resources; _do_node_unfolds(p_scene, p_scene, resources); } -- cgit v1.2.3