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:
@@ -97,12 +97,10 @@ Array ServersDebugger::ServersProfilerFrame::serialize() {
|
||||
arr.push_back(script_time);
|
||||
|
||||
arr.push_back(servers.size());
|
||||
for (int i = 0; i < servers.size(); i++) {
|
||||
ServerInfo &s = servers[i];
|
||||
for (const ServerInfo &s : servers) {
|
||||
arr.push_back(s.name);
|
||||
arr.push_back(s.functions.size() * 2);
|
||||
for (int j = 0; j < s.functions.size(); j++) {
|
||||
ServerFunctionInfo &f = s.functions[j];
|
||||
for (const ServerFunctionInfo &f : s.functions) {
|
||||
arr.push_back(f.name);
|
||||
arr.push_back(f.time);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user