From 436b8bd3f174c2f39f339060c701074b5387855c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Mon, 5 Sep 2022 21:36:26 +0200 Subject: [PATCH] optimized `isSameConstantValue()` a bit (#4441) --- lib/astutils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/astutils.cpp b/lib/astutils.cpp index ea771509d..982c1d49d 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; };