Always pass the script string around by reference
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
#include "Parser/Parser.hpp"
|
||||
#include "Binder/Binder.hpp"
|
||||
|
||||
Script* Script::Create(string script) {
|
||||
Script* Script::Create(const string& script) {
|
||||
auto s = new Script();
|
||||
s -> Parse(std::move(script));
|
||||
s -> Parse(script);
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ Script::~Script() {
|
||||
delete this->_scriptVariables;
|
||||
}
|
||||
|
||||
void Script::Parse(string script) {
|
||||
auto lexer = Lexer(&script, this);
|
||||
void Script::Parse(const string& script) {
|
||||
auto lexer = Lexer(script, this);
|
||||
auto lexResult = lexer.Lex();
|
||||
auto parser = Parser(lexResult, this);
|
||||
auto parseResult = parser.Parse();
|
||||
|
||||
Reference in New Issue
Block a user