From 1abdffe7a029daf634f57132cb5ab5d82a7ccfc9 Mon Sep 17 00:00:00 2001 From: kobewi Date: Fri, 5 Aug 2022 20:35:08 +0200 Subject: Replace Array return types with TypedArray 2 --- main/performance.cpp | 7 ++++--- main/performance.h | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'main') diff --git a/main/performance.cpp b/main/performance.cpp index 0de525134e..bdcd07a216 100644 --- a/main/performance.cpp +++ b/main/performance.cpp @@ -32,6 +32,7 @@ #include "core/object/message_queue.h" #include "core/os/os.h" +#include "core/variant/typed_array.h" #include "scene/main/node.h" #include "scene/main/scene_tree.h" #include "servers/audio_server.h" @@ -240,11 +241,11 @@ Variant Performance::get_custom_monitor(const StringName &p_id) { return return_value; } -Array Performance::get_custom_monitor_names() { +TypedArray Performance::get_custom_monitor_names() { if (!_monitor_map.size()) { - return Array(); + return TypedArray(); } - Array return_array; + TypedArray return_array; return_array.resize(_monitor_map.size()); int index = 0; for (KeyValue i : _monitor_map) { diff --git a/main/performance.h b/main/performance.h index 00e00886ef..597666b57d 100644 --- a/main/performance.h +++ b/main/performance.h @@ -37,6 +37,9 @@ #define PERF_WARN_OFFLINE_FUNCTION #define PERF_WARN_PROCESS_SYNC +template +class TypedArray; + class Performance : public Object { GDCLASS(Performance, Object); @@ -107,7 +110,7 @@ public: void remove_custom_monitor(const StringName &p_id); bool has_custom_monitor(const StringName &p_id); Variant get_custom_monitor(const StringName &p_id); - Array get_custom_monitor_names(); + TypedArray get_custom_monitor_names(); uint64_t get_monitor_modification_time(); -- cgit v1.2.3