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:
@ -510,7 +510,7 @@ void ExtendGDScriptParser::parse_function_symbol(const GDScriptParser::FunctionN
|
||||
node_stack.push_back(p_func->body);
|
||||
|
||||
while (!node_stack.is_empty()) {
|
||||
GDScriptParser::Node *node = node_stack[0];
|
||||
GDScriptParser::Node *node = node_stack.front()->get();
|
||||
node_stack.pop_front();
|
||||
|
||||
switch (node->type) {
|
||||
|
||||
Reference in New Issue
Block a user