ExpressionParser: Make use of std::erase_if
This commit is contained in:
parent
196f8e5123
commit
9aea481e59
|
@ -963,11 +963,9 @@ static ParseResult ParseComplexExpression(const std::string& str)
|
||||||
|
|
||||||
void RemoveInertTokens(std::vector<Token>* tokens)
|
void RemoveInertTokens(std::vector<Token>* tokens)
|
||||||
{
|
{
|
||||||
tokens->erase(std::remove_if(tokens->begin(), tokens->end(),
|
std::erase_if(*tokens, [](const Token& tok) {
|
||||||
[](const Token& tok) {
|
return tok.type == TOK_COMMENT || tok.type == TOK_WHITESPACE;
|
||||||
return tok.type == TOK_COMMENT || tok.type == TOK_WHITESPACE;
|
});
|
||||||
}),
|
|
||||||
tokens->end());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static std::unique_ptr<Expression> ParseBarewordExpression(const std::string& str)
|
static std::unique_ptr<Expression> ParseBarewordExpression(const std::string& str)
|
||||||
|
|
Loading…
Reference in New Issue