summaryrefslogtreecommitdiffstats
path: root/editor/debugger/editor_debugger_inspector.cpp
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2022-05-13 15:04:37 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-05-16 10:37:48 +0200
commit746dddc0673d7261f19b1e056e90e6e3a49ef33a (patch)
tree434b526eb286850ebccc6d2c998a7d90fdb8b5e2 /editor/debugger/editor_debugger_inspector.cpp
parent396def9b66c476f7834604adb7136ca903ed01be (diff)
downloadredot-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/debugger/editor_debugger_inspector.cpp')
-rw-r--r--editor/debugger/editor_debugger_inspector.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/editor/debugger/editor_debugger_inspector.cpp b/editor/debugger/editor_debugger_inspector.cpp
index 854c050793..6d7f3f4ae2 100644
--- a/editor/debugger/editor_debugger_inspector.cpp
+++ b/editor/debugger/editor_debugger_inspector.cpp
@@ -146,7 +146,7 @@ ObjectID EditorDebuggerInspector::add_object(const Array &p_arr) {
debugObj->prop_list.clear();
int new_props_added = 0;
- Set<String> changed;
+ RBSet<String> changed;
for (int i = 0; i < obj.properties.size(); i++) {
PropertyInfo &pinfo = obj.properties[i].first;
Variant &var = obj.properties[i].second;
@@ -193,7 +193,7 @@ ObjectID EditorDebuggerInspector::add_object(const Array &p_arr) {
if (old_prop_size == debugObj->prop_list.size() && new_props_added == 0) {
//only some may have changed, if so, then update those, if exist
- for (Set<String>::Element *E = changed.front(); E; E = E->next()) {
+ for (RBSet<String>::Element *E = changed.front(); E; E = E->next()) {
emit_signal(SNAME("object_property_updated"), debugObj->remote_object_id, E->get());
}
} else {
@@ -276,8 +276,8 @@ void EditorDebuggerInspector::clear_stack_variables() {
}
String EditorDebuggerInspector::get_stack_variable(const String &p_var) {
- for (Map<StringName, Variant>::Element *E = variables->prop_values.front(); E; E = E->next()) {
- String v = E->key().operator String();
+ for (KeyValue<StringName, Variant> &E : variables->prop_values) {
+ String v = E.key.operator String();
if (v.get_slice("/", 1) == p_var) {
return variables->get_variant(v);
}