From 955d5affa857ec1f358c56da8fb1ff4ab6590704 Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Mon, 15 Apr 2024 15:18:34 +0200 Subject: 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 --- modules/mono/class_db_api_json.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules/mono/class_db_api_json.cpp') 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; } } -- cgit v1.2.3