You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-23 15:16:17 +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:
@@ -1302,9 +1302,8 @@ TypedArray<Dictionary> Object::_get_signal_connection_list(const StringName &p_s
|
||||
|
||||
TypedArray<Dictionary> Object::_get_incoming_connections() const {
|
||||
TypedArray<Dictionary> ret;
|
||||
int connections_amount = connections.size();
|
||||
for (int idx_conn = 0; idx_conn < connections_amount; idx_conn++) {
|
||||
ret.push_back(connections[idx_conn]);
|
||||
for (const Object::Connection &connection : connections) {
|
||||
ret.push_back(connection);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user