From 8785db524a82a29b3b94ac3fc4594a8b1eab11d2 Mon Sep 17 00:00:00 2001 From: firewave Date: Mon, 5 Sep 2022 09:26:07 +0200 Subject: [PATCH] optimized `isSameConstantValue()` a bit --- lib/astutils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/astutils.cpp b/lib/astutils.cpp index ea771509d5c..982c1d49d81 100644 --- a/lib/astutils.cpp +++ b/lib/astutils.cpp @@ -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; };