diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-05-12 12:36:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-12 12:36:43 +0200 |
commit | edda6ee9f82ec94f993ebf44486ab7d8abcef193 (patch) | |
tree | 691c51ea7516990b94303afa334d70c66c512cc4 /main | |
parent | 9b7e16a6b8b80fe61881e8f4df28550e18050dd2 (diff) | |
parent | 8b7c7f5a753b43cec10f72b274bb1d70c253652b (diff) |
Merge pull request #60881 from reduz/new-hash-map
Diffstat (limited to 'main')
-rw-r--r-- | main/main.cpp | 10 | ||||
-rw-r--r-- | main/performance.cpp | 4 | ||||
-rw-r--r-- | main/performance.h | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/main/main.cpp b/main/main.cpp index 75c4433b41..9747f5aa11 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -2329,11 +2329,11 @@ bool Main::start() { if (!project_manager && !editor) { // game if (!game_path.is_empty() || !script.is_empty()) { //autoload - OrderedHashMap<StringName, ProjectSettings::AutoloadInfo> autoloads = ProjectSettings::get_singleton()->get_autoload_list(); + HashMap<StringName, ProjectSettings::AutoloadInfo> autoloads = ProjectSettings::get_singleton()->get_autoload_list(); //first pass, add the constants so they exist before any script is loaded - for (OrderedHashMap<StringName, ProjectSettings::AutoloadInfo>::Element E = autoloads.front(); E; E = E.next()) { - const ProjectSettings::AutoloadInfo &info = E.get(); + for (const KeyValue<StringName, ProjectSettings::AutoloadInfo> &E : autoloads) { + const ProjectSettings::AutoloadInfo &info = E.value; if (info.is_singleton) { for (int i = 0; i < ScriptServer::get_language_count(); i++) { @@ -2344,8 +2344,8 @@ bool Main::start() { //second pass, load into global constants List<Node *> to_add; - for (OrderedHashMap<StringName, ProjectSettings::AutoloadInfo>::Element E = autoloads.front(); E; E = E.next()) { - const ProjectSettings::AutoloadInfo &info = E.get(); + for (const KeyValue<StringName, ProjectSettings::AutoloadInfo> &E : autoloads) { + const ProjectSettings::AutoloadInfo &info = E.value; Ref<Resource> res = ResourceLoader::load(info.path); ERR_CONTINUE_MSG(res.is_null(), "Can't autoload: " + info.path); diff --git a/main/performance.cpp b/main/performance.cpp index e80906b4a7..25659b999f 100644 --- a/main/performance.cpp +++ b/main/performance.cpp @@ -247,8 +247,8 @@ Array Performance::get_custom_monitor_names() { Array return_array; return_array.resize(_monitor_map.size()); int index = 0; - for (OrderedHashMap<StringName, MonitorCall>::Element i = _monitor_map.front(); i; i = i.next()) { - return_array.set(index, i.key()); + for (KeyValue<StringName, MonitorCall> i : _monitor_map) { + return_array.set(index, i.key); index++; } return return_array; diff --git a/main/performance.h b/main/performance.h index 927b5b0389..2837d8f512 100644 --- a/main/performance.h +++ b/main/performance.h @@ -32,7 +32,7 @@ #define PERFORMANCE_H #include "core/object/class_db.h" -#include "core/templates/ordered_hash_map.h" +#include "core/templates/hash_map.h" #define PERF_WARN_OFFLINE_FUNCTION #define PERF_WARN_PROCESS_SYNC @@ -58,7 +58,7 @@ class Performance : public Object { Variant call(bool &r_error, String &r_error_message); }; - OrderedHashMap<StringName, MonitorCall> _monitor_map; + HashMap<StringName, MonitorCall> _monitor_map; uint64_t _monitor_modification_time; public: |