ExpressionParser: Make use of std::erase_if

This commit is contained in:
Lioncash 2023-12-12 13:31:58 -05:00
parent 196f8e5123
commit 9aea481e59
1 changed files with 3 additions and 5 deletions

View File

@ -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)