Merge pull request #53507 from qarmin/fast_as_snail

This commit is contained in:
Rémi Verschelde 2021-10-08 14:58:01 +02:00 committed by GitHub
commit 07094f5253
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 7 deletions

View file

@ -1188,8 +1188,8 @@ static bool _guess_identifier_type(GDScriptCompletionContext &p_context, const S
}
}
for (const List<GDScriptParser::Node *>::Element *E = blk->statements.front(); E; E = E->next()) {
const GDScriptParser::Node *expr = E->get();
for (int z = 0; z < blk->statements.size(); z++) {
const GDScriptParser::Node *expr = blk->statements[z];
if (expr->line > p_context.line || expr->type != GDScriptParser::Node::TYPE_OPERATOR) {
continue;
}

View file

@ -2793,8 +2793,8 @@ void GDScriptParser::_transform_match_statment(MatchNode *p_match_statement) {
op->arguments.push_back(local_var->assign);
local_var->assign_op = op;
branch->body->statements.push_front(op);
branch->body->statements.push_front(local_var);
branch->body->statements.insert(0, op);
branch->body->statements.insert(0, local_var);
}
compiled_branch.body = branch->body;
@ -8252,8 +8252,8 @@ void GDScriptParser::_check_block_types(BlockNode *p_block) {
Node *last_var_assign = nullptr;
// Check each statement
for (List<Node *>::Element *E = p_block->statements.front(); E; E = E->next()) {
Node *statement = E->get();
for (int z = 0; z < p_block->statements.size(); z++) {
Node *statement = p_block->statements[z];
switch (statement->type) {
case Node::TYPE_NEWLINE:
case Node::TYPE_BREAKPOINT: {

View file

@ -234,7 +234,7 @@ public:
struct BlockNode : public Node {
ClassNode *parent_class;
BlockNode *parent_block;
List<Node *> statements;
Vector<Node *> statements;
Map<StringName, LocalVarNode *> variables;
bool has_return = false;
bool can_break = false;