Merge pull request #12399 from lioncash/erasing

General: Make use of std::erase_if/std::erase where applicable
This commit is contained in:
Tilka 2023-12-12 20:54:52 +00:00 committed by GitHub
commit 8cbb2c2e44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 65 additions and 84 deletions

View file

@ -963,11 +963,9 @@ static ParseResult ParseComplexExpression(const std::string& str)
void RemoveInertTokens(std::vector<Token>* tokens)
{
tokens->erase(std::remove_if(tokens->begin(), tokens->end(),
[](const Token& tok) {
return tok.type == TOK_COMMENT || tok.type == TOK_WHITESPACE;
}),
tokens->end());
std::erase_if(*tokens, [](const Token& tok) {
return tok.type == TOK_COMMENT || tok.type == TOK_WHITESPACE;
});
}
static std::unique_ptr<Expression> ParseBarewordExpression(const std::string& str)