You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
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
This commit is contained in:
@@ -188,11 +188,11 @@ static void recursively_disassemble_functions(const Ref<GDScript> script, const
|
||||
|
||||
const MethodInfo &mi = func->get_method_info();
|
||||
String signature = "Disassembling " + mi.name + "(";
|
||||
for (int i = 0; i < mi.arguments.size(); i++) {
|
||||
if (i > 0) {
|
||||
for (List<PropertyInfo>::ConstIterator arg_itr = mi.arguments.begin(); arg_itr != mi.arguments.end(); ++arg_itr) {
|
||||
if (arg_itr != mi.arguments.begin()) {
|
||||
signature += ", ";
|
||||
}
|
||||
signature += mi.arguments[i].name;
|
||||
signature += arg_itr->name;
|
||||
}
|
||||
print_line(signature + ")");
|
||||
#ifdef TOOLS_ENABLED
|
||||
|
||||
Reference in New Issue
Block a user