optimized `isSameConstantValue()` a bit (#4441)

This commit is contained in:
Oliver Stöneberg 2022-09-05 21:36:26 +02:00 committed by GitHub
parent 251de269ec
commit 436b8bd3f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -1308,7 +1308,7 @@ static inline bool isSameConstantValue(bool macro, const Token* tok1, const Toke
return false;
auto adjustForCast = [](const Token* tok) {
if (Token::Match(tok->previous(), "%type% (|{") && tok->previous()->isStandardType() && tok->astOperand2())
if (tok->astOperand2() && Token::Match(tok->previous(), "%type% (|{") && tok->previous()->isStandardType())
return tok->astOperand2();
return tok;
};