Work on performance improvements
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-13 16:26:10 +02:00
parent e93bcab14d
commit 1cb65f17c9
19 changed files with 84 additions and 108 deletions

View File

@@ -13,7 +13,7 @@ BoundScriptStatement *Binder::Bind(Script* script, ParsedScriptStatement *s, Bou
for (int i = 0; i < statements->size(); i++){
boundStatements[i] = binder.BindStatement(statements->at(i));
}
return new BoundScriptStatement(boundStatements, scriptScope->GetDeepestScope());
return new BoundScriptStatement(boundStatements, scriptScope->GetLocalVariableCount());
}
Binder::~Binder() {
@@ -434,7 +434,7 @@ BoundExpression *Binder::BindTableExpression(ParsedTableExpression *expression)
auto block = this -> BindBlockStatement(expression -> GetBlock());
this -> _scope = currentScope;
auto tableType = shared_ptr<TableScriptType>(new TableScriptType(tableScope, innerScope->GetDeepestScope()));
auto tableType = shared_ptr<TableScriptType>(new TableScriptType(tableScope, innerScope->GetLocalVariableCount()));
delete innerScope;
return new BoundTableExpression((BoundBlockStatement*)block, tableType, expression->GetStartPosition(), expression->GetLength());