Skip to content

Commit c58fab0

Browse files
committed
Removed unnecessary string comparison in Tokenizer::simplifyKnownVariablesSimplify.
1 parent 1eba077 commit c58fab0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/tokenize.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6822,10 +6822,10 @@ bool Tokenizer::simplifyKnownVariablesSimplify(Token **tok2, Token *tok3, unsign
68226822
}
68236823

68246824
// Delete pointer alias
6825-
if (pointeralias && tok3->str() == "delete" &&
6826-
(Token::Match(tok3, "delete %varid% ;", varid) ||
6827-
Token::Match(tok3, "delete [ ] %varid%", varid))) {
6828-
tok3 = (tok3->next() && tok3->next()->str() == "[") ? tok3->tokAt(3) : tok3->next();
6825+
if (pointeralias && (tok3->str() == "delete") && tok3->next() &&
6826+
(Token::Match(tok3->next(), "%varid% ;", varid) ||
6827+
Token::Match(tok3->next(), "[ ] %varid%", varid))) {
6828+
tok3 = (tok3->next()->str() == "[") ? tok3->tokAt(3) : tok3->next();
68296829
tok3->str(value);
68306830
tok3->varId(valueVarId);
68316831
ret = true;

0 commit comments

Comments
 (0)