summaryrefslogtreecommitdiff
path: root/editor/debugger
diff options
context:
space:
mode:
Diffstat (limited to 'editor/debugger')
-rw-r--r--editor/debugger/debug_adapter/debug_adapter_parser.cpp14
-rw-r--r--editor/debugger/debug_adapter/debug_adapter_protocol.cpp8
-rw-r--r--editor/debugger/debug_adapter/debug_adapter_protocol.h4
-rw-r--r--editor/debugger/debug_adapter/debug_adapter_types.h7
-rw-r--r--editor/debugger/editor_debugger_inspector.cpp8
-rw-r--r--editor/debugger/editor_debugger_inspector.h6
-rw-r--r--editor/debugger/editor_debugger_node.cpp2
-rw-r--r--editor/debugger/editor_debugger_node.h12
-rw-r--r--editor/debugger/editor_debugger_server.cpp2
-rw-r--r--editor/debugger/editor_debugger_server.h2
-rw-r--r--editor/debugger/editor_debugger_tree.h2
-rw-r--r--editor/debugger/editor_network_profiler.h2
-rw-r--r--editor/debugger/editor_performance_profiler.cpp84
-rw-r--r--editor/debugger/editor_performance_profiler.h8
-rw-r--r--editor/debugger/editor_profiler.cpp38
-rw-r--r--editor/debugger/editor_profiler.h6
-rw-r--r--editor/debugger/script_editor_debugger.cpp8
-rw-r--r--editor/debugger/script_editor_debugger.h8
18 files changed, 121 insertions, 100 deletions
diff --git a/editor/debugger/debug_adapter/debug_adapter_parser.cpp b/editor/debugger/debug_adapter/debug_adapter_parser.cpp
index e7baeeeded..0caeb90108 100644
--- a/editor/debugger/debug_adapter/debug_adapter_parser.cpp
+++ b/editor/debugger/debug_adapter/debug_adapter_parser.cpp
@@ -381,12 +381,12 @@ Dictionary DebugAdapterParser::req_scopes(const Dictionary &p_params) const {
DAP::StackFrame frame;
frame.id = frame_id;
- Map<DAP::StackFrame, List<int>>::Element *E = DebugAdapterProtocol::get_singleton()->stackframe_list.find(frame);
+ HashMap<DAP::StackFrame, List<int>, DAP::StackFrame>::Iterator E = DebugAdapterProtocol::get_singleton()->stackframe_list.find(frame);
if (E) {
- ERR_FAIL_COND_V(E->value().size() != 3, prepare_error_response(p_params, DAP::ErrorType::UNKNOWN));
+ ERR_FAIL_COND_V(E->value.size() != 3, prepare_error_response(p_params, DAP::ErrorType::UNKNOWN));
for (int i = 0; i < 3; i++) {
DAP::Scope scope;
- scope.variablesReference = E->value()[i];
+ scope.variablesReference = E->value[i];
switch (i) {
case 0:
scope.name = "Locals";
@@ -424,16 +424,16 @@ Dictionary DebugAdapterParser::req_variables(const Dictionary &p_params) const {
Dictionary args = p_params["arguments"];
int variable_id = args["variablesReference"];
- Map<int, Array>::Element *E = DebugAdapterProtocol::get_singleton()->variable_list.find(variable_id);
+ HashMap<int, Array>::Iterator E = DebugAdapterProtocol::get_singleton()->variable_list.find(variable_id);
if (E) {
if (!DebugAdapterProtocol::get_singleton()->get_current_peer()->supportsVariableType) {
- for (int i = 0; i < E->value().size(); i++) {
- Dictionary variable = E->value()[i];
+ for (int i = 0; i < E->value.size(); i++) {
+ Dictionary variable = E->value[i];
variable.erase("type");
}
}
- body["variables"] = E ? E->value() : Array();
+ body["variables"] = E ? E->value : Array();
return response;
} else {
return Dictionary();
diff --git a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp
index fea4c2b156..92ea0f15e9 100644
--- a/editor/debugger/debug_adapter/debug_adapter_protocol.cpp
+++ b/editor/debugger/debug_adapter/debug_adapter_protocol.cpp
@@ -918,11 +918,11 @@ void DebugAdapterProtocol::on_debug_stack_frame_vars(const int &p_size) {
DAP::StackFrame frame;
frame.id = _current_frame;
ERR_FAIL_COND(!stackframe_list.has(frame));
- List<int> scope_ids = stackframe_list.find(frame)->value();
+ List<int> scope_ids = stackframe_list.find(frame)->value;
for (List<int>::Element *E = scope_ids.front(); E; E = E->next()) {
int variable_id = E->get();
if (variable_list.has(variable_id)) {
- variable_list.find(variable_id)->value().clear();
+ variable_list.find(variable_id)->value.clear();
} else {
variable_list.insert(variable_id, Array());
}
@@ -937,7 +937,7 @@ void DebugAdapterProtocol::on_debug_stack_frame_var(const Array &p_data) {
DAP::StackFrame frame;
frame.id = _current_frame;
- List<int> scope_ids = stackframe_list.find(frame)->value();
+ List<int> scope_ids = stackframe_list.find(frame)->value;
ERR_FAIL_COND(scope_ids.size() != 3);
ERR_FAIL_INDEX(stack_var.type, 3);
int variable_id = scope_ids[stack_var.type];
@@ -949,7 +949,7 @@ void DebugAdapterProtocol::on_debug_stack_frame_var(const Array &p_data) {
variable.type = Variant::get_type_name(stack_var.value.get_type());
variable.variablesReference = parse_variant(stack_var.value);
- variable_list.find(variable_id)->value().push_back(variable.to_json());
+ variable_list.find(variable_id)->value.push_back(variable.to_json());
_remaining_vars--;
}
diff --git a/editor/debugger/debug_adapter/debug_adapter_protocol.h b/editor/debugger/debug_adapter/debug_adapter_protocol.h
index 66db75c634..a17e550dfc 100644
--- a/editor/debugger/debug_adapter/debug_adapter_protocol.h
+++ b/editor/debugger/debug_adapter/debug_adapter_protocol.h
@@ -115,8 +115,8 @@ private:
int stackframe_id = 0;
int variable_id = 0;
List<DAP::Breakpoint> breakpoint_list;
- Map<DAP::StackFrame, List<int>> stackframe_list;
- Map<int, Array> variable_list;
+ HashMap<DAP::StackFrame, List<int>, DAP::StackFrame> stackframe_list;
+ HashMap<int, Array> variable_list;
public:
friend class DebugAdapterServer;
diff --git a/editor/debugger/debug_adapter/debug_adapter_types.h b/editor/debugger/debug_adapter/debug_adapter_types.h
index 77b70909b3..4d77b6d51c 100644
--- a/editor/debugger/debug_adapter/debug_adapter_types.h
+++ b/editor/debugger/debug_adapter/debug_adapter_types.h
@@ -219,8 +219,11 @@ struct StackFrame {
int line;
int column;
- bool operator<(const StackFrame &p_other) const {
- return id < p_other.id;
+ static uint32_t hash(const StackFrame &p_frame) {
+ return hash_djb2_one_32(p_frame.id);
+ }
+ bool operator==(const StackFrame &p_other) const {
+ return id == p_other.id;
}
_FORCE_INLINE_ void from_json(const Dictionary &p_params) {
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);
}
diff --git a/editor/debugger/editor_debugger_inspector.h b/editor/debugger/editor_debugger_inspector.h
index 2bf5bf3419..72b259c8b5 100644
--- a/editor/debugger/editor_debugger_inspector.h
+++ b/editor/debugger/editor_debugger_inspector.h
@@ -46,7 +46,7 @@ public:
ObjectID remote_object_id;
String type_name;
List<PropertyInfo> prop_list;
- Map<StringName, Variant> prop_values;
+ HashMap<StringName, Variant> prop_values;
ObjectID get_remote_object_id() { return remote_object_id; };
String get_title();
@@ -68,8 +68,8 @@ class EditorDebuggerInspector : public EditorInspector {
private:
ObjectID inspected_object_id;
- Map<ObjectID, EditorDebuggerRemoteObject *> remote_objects;
- Set<Ref<Resource>> remote_dependencies;
+ HashMap<ObjectID, EditorDebuggerRemoteObject *> remote_objects;
+ RBSet<Ref<Resource>> remote_dependencies;
EditorDebuggerRemoteObject *variables = nullptr;
void _object_selected(ObjectID p_object);
diff --git a/editor/debugger/editor_debugger_node.cpp b/editor/debugger/editor_debugger_node.cpp
index c0685af572..de26b56ab6 100644
--- a/editor/debugger/editor_debugger_node.cpp
+++ b/editor/debugger/editor_debugger_node.cpp
@@ -118,7 +118,7 @@ ScriptEditorDebugger *EditorDebuggerNode::_add_debugger() {
}
if (!debugger_plugins.is_empty()) {
- for (Set<Ref<Script>>::Element *i = debugger_plugins.front(); i; i = i->next()) {
+ for (RBSet<Ref<Script>>::Element *i = debugger_plugins.front(); i; i = i->next()) {
node->add_debugger_plugin(i->get());
}
}
diff --git a/editor/debugger/editor_debugger_node.h b/editor/debugger/editor_debugger_node.h
index b4fbb90301..40e9cf47f9 100644
--- a/editor/debugger/editor_debugger_node.h
+++ b/editor/debugger/editor_debugger_node.h
@@ -70,6 +70,14 @@ private:
String source;
int line = 0;
+ static uint32_t hash(const Breakpoint &p_val) {
+ uint32_t h = HashMapHasherDefault::hash(p_val.source);
+ return hash_djb2_one_32(p_val.line, h);
+ }
+ bool operator==(const Breakpoint &p_b) const {
+ return (line == p_b.line && source == p_b.source);
+ }
+
bool operator<(const Breakpoint &p_b) const {
if (line == p_b.line) {
return source < p_b.source;
@@ -102,9 +110,9 @@ private:
bool debug_with_external_editor = false;
bool hide_on_stop = true;
CameraOverride camera_override = OVERRIDE_NONE;
- Map<Breakpoint, bool> breakpoints;
+ HashMap<Breakpoint, bool, Breakpoint> breakpoints;
- Set<Ref<Script>> debugger_plugins;
+ RBSet<Ref<Script>> debugger_plugins;
ScriptEditorDebugger *_add_debugger();
EditorDebuggerRemoteObject *get_inspected_remote_object();
diff --git a/editor/debugger/editor_debugger_server.cpp b/editor/debugger/editor_debugger_server.cpp
index bce131a5fe..63390825c6 100644
--- a/editor/debugger/editor_debugger_server.cpp
+++ b/editor/debugger/editor_debugger_server.cpp
@@ -122,7 +122,7 @@ Ref<RemoteDebuggerPeer> EditorDebuggerServerTCP::take_connection() {
}
/// EditorDebuggerServer
-Map<StringName, EditorDebuggerServer::CreateServerFunc> EditorDebuggerServer::protocols;
+HashMap<StringName, EditorDebuggerServer::CreateServerFunc> EditorDebuggerServer::protocols;
EditorDebuggerServer *EditorDebuggerServer::create(const String &p_protocol) {
ERR_FAIL_COND_V(!protocols.has(p_protocol), nullptr);
diff --git a/editor/debugger/editor_debugger_server.h b/editor/debugger/editor_debugger_server.h
index bda4a1ce7d..adf9a27c71 100644
--- a/editor/debugger/editor_debugger_server.h
+++ b/editor/debugger/editor_debugger_server.h
@@ -39,7 +39,7 @@ public:
typedef EditorDebuggerServer *(*CreateServerFunc)(const String &p_uri);
private:
- static Map<StringName, CreateServerFunc> protocols;
+ static HashMap<StringName, CreateServerFunc> protocols;
public:
static void initialize();
diff --git a/editor/debugger/editor_debugger_tree.h b/editor/debugger/editor_debugger_tree.h
index 58af52b01f..8ba03367c9 100644
--- a/editor/debugger/editor_debugger_tree.h
+++ b/editor/debugger/editor_debugger_tree.h
@@ -48,7 +48,7 @@ private:
ObjectID inspected_object_id;
int debugger_id = 0;
bool updating_scene_tree = false;
- Set<ObjectID> unfold_cache;
+ RBSet<ObjectID> unfold_cache;
PopupMenu *item_menu = nullptr;
EditorFileDialog *file_dialog = nullptr;
String last_filter;
diff --git a/editor/debugger/editor_network_profiler.h b/editor/debugger/editor_network_profiler.h
index 3a604f5564..d2e70a083d 100644
--- a/editor/debugger/editor_network_profiler.h
+++ b/editor/debugger/editor_network_profiler.h
@@ -50,7 +50,7 @@ private:
Timer *frame_delay = nullptr;
- Map<ObjectID, SceneDebugger::RPCNodeInfo> nodes_data;
+ HashMap<ObjectID, SceneDebugger::RPCNodeInfo> nodes_data;
void _update_frame();
diff --git a/editor/debugger/editor_performance_profiler.cpp b/editor/debugger/editor_performance_profiler.cpp
index c821561ca6..897c5ae7da 100644
--- a/editor/debugger/editor_performance_profiler.cpp
+++ b/editor/debugger/editor_performance_profiler.cpp
@@ -97,9 +97,9 @@ void EditorPerformanceProfiler::_monitor_select() {
void EditorPerformanceProfiler::_monitor_draw() {
Vector<StringName> active;
- for (OrderedHashMap<StringName, Monitor>::Element i = monitors.front(); i; i = i.next()) {
- if (i.value().item->is_checked(0)) {
- active.push_back(i.key());
+ for (const KeyValue<StringName, Monitor> &E : monitors) {
+ if (E.value.item->is_checked(0)) {
+ active.push_back(E.key);
}
}
@@ -203,23 +203,23 @@ void EditorPerformanceProfiler::_monitor_draw() {
}
void EditorPerformanceProfiler::_build_monitor_tree() {
- Set<StringName> monitor_checked;
- for (OrderedHashMap<StringName, Monitor>::Element i = monitors.front(); i; i = i.next()) {
- if (i.value().item && i.value().item->is_checked(0)) {
- monitor_checked.insert(i.key());
+ RBSet<StringName> monitor_checked;
+ for (KeyValue<StringName, Monitor> &E : monitors) {
+ if (E.value.item && E.value.item->is_checked(0)) {
+ monitor_checked.insert(E.key);
}
}
base_map.clear();
monitor_tree->get_root()->clear_children();
- for (OrderedHashMap<StringName, Monitor>::Element i = monitors.front(); i; i = i.next()) {
- TreeItem *base = _get_monitor_base(i.value().base);
- TreeItem *item = _create_monitor_item(i.value().name, base);
- item->set_checked(0, monitor_checked.has(i.key()));
- i.value().item = item;
- if (!i.value().history.is_empty()) {
- i.value().update_value(i.value().history.front()->get());
+ for (KeyValue<StringName, Monitor> &E : monitors) {
+ TreeItem *base = _get_monitor_base(E.value.base);
+ TreeItem *item = _create_monitor_item(E.value.name, base);
+ item->set_checked(0, monitor_checked.has(E.key));
+ E.value.item = item;
+ if (!E.value.history.is_empty()) {
+ E.value.update_value(E.value.history.front()->get());
}
}
}
@@ -252,9 +252,9 @@ void EditorPerformanceProfiler::_marker_input(const Ref<InputEvent> &p_event) {
Ref<InputEventMouseButton> mb = p_event;
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MouseButton::LEFT) {
Vector<StringName> active;
- for (OrderedHashMap<StringName, Monitor>::Element i = monitors.front(); i; i = i.next()) {
- if (i.value().item->is_checked(0)) {
- active.push_back(i.key());
+ for (KeyValue<StringName, Monitor> &E : monitors) {
+ if (E.value.item->is_checked(0)) {
+ active.push_back(E.key);
}
}
if (active.size() > 0) {
@@ -293,12 +293,16 @@ void EditorPerformanceProfiler::_marker_input(const Ref<InputEvent> &p_event) {
}
void EditorPerformanceProfiler::reset() {
- for (OrderedHashMap<StringName, Monitor>::Element i = monitors.front(); i; i = i.next()) {
- if (String(i.key()).begins_with("custom:")) {
- monitors.erase(i);
+ HashMap<StringName, Monitor>::Iterator E = monitors.begin();
+ while (E != monitors.end()) {
+ HashMap<StringName, Monitor>::Iterator N = E;
+ ++N;
+ if (String(E->key).begins_with("custom:")) {
+ monitors.remove(E);
} else {
- i.value().reset();
+ E->value.reset();
}
+ E = N;
}
_build_monitor_tree();
@@ -308,43 +312,49 @@ void EditorPerformanceProfiler::reset() {
}
void EditorPerformanceProfiler::update_monitors(const Vector<StringName> &p_names) {
- OrderedHashMap<StringName, int> names;
+ HashMap<StringName, int> names;
for (int i = 0; i < p_names.size(); i++) {
names.insert("custom:" + p_names[i], Performance::MONITOR_MAX + i);
}
- for (OrderedHashMap<StringName, Monitor>::Element i = monitors.front(); i; i = i.next()) {
- if (String(i.key()).begins_with("custom:")) {
- if (!names.has(i.key())) {
- monitors.erase(i);
- } else {
- i.value().frame_index = names[i.key()];
- names.erase(i.key());
+ {
+ HashMap<StringName, Monitor>::Iterator E = monitors.begin();
+ while (E != monitors.end()) {
+ HashMap<StringName, Monitor>::Iterator N = E;
+ ++N;
+ if (String(E->key).begins_with("custom:")) {
+ if (!names.has(E->key)) {
+ monitors.remove(E);
+ } else {
+ E->value.frame_index = names[E->key];
+ names.erase(E->key);
+ }
}
+ E = N;
}
}
- for (OrderedHashMap<StringName, int>::Element i = names.front(); i; i = i.next()) {
- String name = String(i.key()).replace_first("custom:", "");
+ for (const KeyValue<StringName, int> &E : names) {
+ String name = String(E.key).replace_first("custom:", "");
String base = "Custom";
if (name.get_slice_count("/") == 2) {
base = name.get_slicec('/', 0);
name = name.get_slicec('/', 1);
}
- monitors.insert(i.key(), Monitor(name, base, i.value(), Performance::MONITOR_TYPE_QUANTITY, nullptr));
+ monitors.insert(E.key, Monitor(name, base, E.value, Performance::MONITOR_TYPE_QUANTITY, nullptr));
}
_build_monitor_tree();
}
void EditorPerformanceProfiler::add_profile_frame(const Vector<float> &p_values) {
- for (OrderedHashMap<StringName, Monitor>::Element i = monitors.front(); i; i = i.next()) {
+ for (KeyValue<StringName, Monitor> &E : monitors) {
float data = 0.0f;
- if (i.value().frame_index >= 0 && i.value().frame_index < p_values.size()) {
- data = p_values[i.value().frame_index];
+ if (E.value.frame_index >= 0 && E.value.frame_index < p_values.size()) {
+ data = p_values[E.value.frame_index];
}
- i.value().history.push_front(data);
- i.value().update_value(data);
+ E.value.history.push_front(data);
+ E.value.update_value(data);
}
marker_frame++;
monitor_draw->update();
diff --git a/editor/debugger/editor_performance_profiler.h b/editor/debugger/editor_performance_profiler.h
index ab0e43de2f..607de5a134 100644
--- a/editor/debugger/editor_performance_profiler.h
+++ b/editor/debugger/editor_performance_profiler.h
@@ -31,8 +31,8 @@
#ifndef EDITOR_PERFORMANCE_PROFILER_H
#define EDITOR_PERFORMANCE_PROFILER_H
-#include "core/templates/map.h"
-#include "core/templates/ordered_hash_map.h"
+#include "core/templates/hash_map.h"
+#include "core/templates/rb_map.h"
#include "main/performance.h"
#include "scene/gui/control.h"
#include "scene/gui/label.h"
@@ -59,9 +59,9 @@ private:
void reset();
};
- OrderedHashMap<StringName, Monitor> monitors;
+ HashMap<StringName, Monitor> monitors;
- Map<StringName, TreeItem *> base_map;
+ HashMap<StringName, TreeItem *> base_map;
Tree *monitor_tree = nullptr;
Control *monitor_draw = nullptr;
Label *info_message = nullptr;
diff --git a/editor/debugger/editor_profiler.cpp b/editor/debugger/editor_profiler.cpp
index 50f3b19cc2..55c3c7af78 100644
--- a/editor/debugger/editor_profiler.cpp
+++ b/editor/debugger/editor_profiler.cpp
@@ -198,18 +198,18 @@ void EditorProfiler::_update_plot() {
for (int i = 0; i < total_metrics; i++) {
const Metric &m = _get_frame_metric(i);
- for (Set<StringName>::Element *E = plot_sigs.front(); E; E = E->next()) {
- const Map<StringName, Metric::Category *>::Element *F = m.category_ptrs.find(E->get());
+ for (RBSet<StringName>::Element *E = plot_sigs.front(); E; E = E->next()) {
+ HashMap<StringName, Metric::Category *>::ConstIterator F = m.category_ptrs.find(E->get());
if (F) {
- highest = MAX(F->get()->total_time, highest);
+ highest = MAX(F->value->total_time, highest);
}
- const Map<StringName, Metric::Category::Item *>::Element *G = m.item_ptrs.find(E->get());
+ HashMap<StringName, Metric::Category::Item *>::ConstIterator G = m.item_ptrs.find(E->get());
if (G) {
if (use_self) {
- highest = MAX(G->get()->self, highest);
+ highest = MAX(G->value->self, highest);
} else {
- highest = MAX(G->get()->total, highest);
+ highest = MAX(G->value->total, highest);
}
}
}
@@ -225,7 +225,7 @@ void EditorProfiler::_update_plot() {
int *column = columnv.ptrw();
- Map<StringName, int> prev_plots;
+ HashMap<StringName, int> prev_plots;
for (int i = 0; i < total_metrics * w / frame_metrics.size() - 1; i++) {
for (int j = 0; j < h * 4; j++) {
@@ -234,32 +234,32 @@ void EditorProfiler::_update_plot() {
int current = i * frame_metrics.size() / w;
- for (Set<StringName>::Element *E = plot_sigs.front(); E; E = E->next()) {
+ for (RBSet<StringName>::Element *E = plot_sigs.front(); E; E = E->next()) {
const Metric &m = _get_frame_metric(current);
float value = 0;
- const Map<StringName, Metric::Category *>::Element *F = m.category_ptrs.find(E->get());
+ HashMap<StringName, Metric::Category *>::ConstIterator F = m.category_ptrs.find(E->get());
if (F) {
- value = F->get()->total_time;
+ value = F->value->total_time;
}
- const Map<StringName, Metric::Category::Item *>::Element *G = m.item_ptrs.find(E->get());
+ HashMap<StringName, Metric::Category::Item *>::ConstIterator G = m.item_ptrs.find(E->get());
if (G) {
if (use_self) {
- value = G->get()->self;
+ value = G->value->self;
} else {
- value = G->get()->total;
+ value = G->value->total;
}
}
int plot_pos = CLAMP(int(value * h / highest), 0, h - 1);
int prev_plot = plot_pos;
- Map<StringName, int>::Element *H = prev_plots.find(E->get());
+ HashMap<StringName, int>::Iterator H = prev_plots.find(E->get());
if (H) {
- prev_plot = H->get();
- H->get() = plot_pos;
+ prev_plot = H->value;
+ H->value = plot_pos;
} else {
prev_plots[E->get()] = plot_pos;
}
@@ -515,7 +515,7 @@ Vector<Vector<String>> EditorProfiler::get_data_as_csv() const {
}
// Different metrics may contain different number of categories.
- Set<StringName> possible_signatures;
+ RBSet<StringName> possible_signatures;
for (int i = 0; i < frame_metrics.size(); i++) {
const Metric &m = frame_metrics[i];
if (!m.valid) {
@@ -530,11 +530,11 @@ Vector<Vector<String>> EditorProfiler::get_data_as_csv() const {
}
// Generate CSV header and cache indices.
- Map<StringName, int> sig_map;
+ HashMap<StringName, int> sig_map;
Vector<String> signatures;
signatures.resize(possible_signatures.size());
int sig_index = 0;
- for (const Set<StringName>::Element *E = possible_signatures.front(); E; E = E->next()) {
+ for (const RBSet<StringName>::Element *E = possible_signatures.front(); E; E = E->next()) {
signatures.write[sig_index] = E->get();
sig_map[E->get()] = sig_index;
sig_index++;
diff --git a/editor/debugger/editor_profiler.h b/editor/debugger/editor_profiler.h
index 2aef654a2f..77fbb254dc 100644
--- a/editor/debugger/editor_profiler.h
+++ b/editor/debugger/editor_profiler.h
@@ -73,8 +73,8 @@ public:
Vector<Category> categories;
- Map<StringName, Category *> category_ptrs;
- Map<StringName, Category::Item *> item_ptrs;
+ HashMap<StringName, Category *> category_ptrs;
+ HashMap<StringName, Category::Item *> item_ptrs;
};
enum DisplayMode {
@@ -98,7 +98,7 @@ private:
Tree *variables = nullptr;
HSplitContainer *h_split = nullptr;
- Set<StringName> plot_sigs;
+ RBSet<StringName> plot_sigs;
OptionButton *display_mode = nullptr;
OptionButton *display_time = nullptr;
diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp
index 90679657ba..44a7aade09 100644
--- a/editor/debugger/script_editor_debugger.cpp
+++ b/editor/debugger/script_editor_debugger.cpp
@@ -742,9 +742,9 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, const Array &p_da
bool parsed = false;
const String cap = p_msg.substr(0, colon_index);
- Map<StringName, Callable>::Element *element = captures.find(cap);
+ HashMap<StringName, Callable>::Iterator element = captures.find(cap);
if (element) {
- Callable &c = element->value();
+ Callable &c = element->value;
ERR_FAIL_COND_MSG(c.is_null(), "Invalid callable registered: " + cap);
Variant cmd = p_msg.substr(colon_index + 1), data = p_data;
const Variant *args[2] = { &cmd, &data };
@@ -1050,10 +1050,10 @@ int ScriptEditorDebugger::_get_node_path_cache(const NodePath &p_path) {
}
int ScriptEditorDebugger::_get_res_path_cache(const String &p_path) {
- Map<String, int>::Element *E = res_path_cache.find(p_path);
+ HashMap<String, int>::Iterator E = res_path_cache.find(p_path);
if (E) {
- return E->get();
+ return E->value;
}
last_path_id++;
diff --git a/editor/debugger/script_editor_debugger.h b/editor/debugger/script_editor_debugger.h
index ad90e63c16..d445fe48d1 100644
--- a/editor/debugger/script_editor_debugger.h
+++ b/editor/debugger/script_editor_debugger.h
@@ -131,7 +131,7 @@ private:
// Each debugger should have it's tree in the future I guess.
const Tree *editor_remote_tree = nullptr;
- Map<int, String> profiler_signature;
+ HashMap<int, String> profiler_signature;
Tree *vmem_tree = nullptr;
Button *vmem_refresh = nullptr;
@@ -147,7 +147,7 @@ private:
HashMap<NodePath, int> node_path_cache;
int last_path_id;
- Map<String, int> res_path_cache;
+ HashMap<String, int> res_path_cache;
EditorProfiler *profiler = nullptr;
EditorVisualProfiler *visual_profiler = nullptr;
@@ -163,9 +163,9 @@ private:
EditorDebuggerNode::CameraOverride camera_override;
- Map<Ref<Script>, EditorDebuggerPlugin *> debugger_plugins;
+ HashMap<Ref<Script>, EditorDebuggerPlugin *> debugger_plugins;
- Map<StringName, Callable> captures;
+ HashMap<StringName, Callable> captures;
void _stack_dump_frame_selected();