Skip to content
Permalink
Browse files

ExpressionParser: Make Lexer ctor explicit and move argument.

  • Loading branch information...
jordan-woyak committed Oct 12, 2019
1 parent 72302d9 commit 7295458c11e1465c9e0a823620ea935396c4ea39
@@ -34,7 +34,7 @@ bool Token::IsBinaryOperator() const
return type >= TOK_BINARY_OPS_BEGIN && type < TOK_BINARY_OPS_END;
}

Lexer::Lexer(const std::string& expr_) : expr(expr_)
Lexer::Lexer(std::string expr_) : expr(std::move(expr_))
{
it = expr.begin();
}
@@ -71,7 +71,7 @@ class Lexer
std::string expr;
std::string::iterator it;

Lexer(const std::string& expr_);
explicit Lexer(std::string expr_);

ParseStatus Tokenize(std::vector<Token>& tokens);

0 comments on commit 7295458

Please sign in to comment.
You can’t perform that action at this time.