summaryrefslogtreecommitdiffstats
path: root/modules/mono/class_db_api_json.cpp
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-04-15 15:18:34 +0200
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-05-04 16:08:55 +0200
commit955d5affa857ec1f358c56da8fb1ff4ab6590704 (patch)
treeb667ac9f6f62bff17ce032683c0eb09727660555 /modules/mono/class_db_api_json.cpp
parent7ebc866418b075df58cbe4e31fcf8b0c3acd70a1 (diff)
downloadredot-engine-955d5affa857ec1f358c56da8fb1ff4ab6590704.tar.gz
Reduce and prevent unnecessary random-access to `List`
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when accessing a single element) * Removed subscript operator, in favor of a more explicit `get` * Added conversion from `Iterator` to `ConstIterator` * Remade existing operations into other solutions when applicable
Diffstat (limited to 'modules/mono/class_db_api_json.cpp')
-rw-r--r--modules/mono/class_db_api_json.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/mono/class_db_api_json.cpp b/modules/mono/class_db_api_json.cpp
index c4aba577db..04af60e22f 100644
--- a/modules/mono/class_db_api_json.cpp
+++ b/modules/mono/class_db_api_json.cpp
@@ -166,10 +166,10 @@ void class_db_api_to_json(const String &p_output_file, ClassDB::APIType p_api) {
Array arguments;
signal_dict["arguments"] = arguments;
- for (int i = 0; i < mi.arguments.size(); i++) {
+ for (const PropertyInfo &pi : mi.arguments) {
Dictionary argument_dict;
arguments.push_back(argument_dict);
- argument_dict["type"] = mi.arguments[i].type;
+ argument_dict["type"] = pi.type;
}
}