From 5a642ac35e562230532edbe196871740e6a44de7 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Tue, 26 Dec 2017 02:07:24 +0300 Subject: [PATCH] Omit unneeded computations --- lib/checkcondition.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/checkcondition.cpp b/lib/checkcondition.cpp index 9b6834aef..1df4433a1 100644 --- a/lib/checkcondition.cpp +++ b/lib/checkcondition.cpp @@ -180,9 +180,9 @@ bool CheckCondition::assignIfParseScope(const Token * const assignTok, } if (Token::Match(tok2,"&&|%oror%|( %varid% ==|!= %num% &&|%oror%|)", varid)) { const Token *vartok = tok2->next(); - const std::string& op(vartok->strAt(1)); const MathLib::bigint num2 = MathLib::toLongNumber(vartok->strAt(2)); if ((num & num2) != ((bitop=='&') ? num2 : num)) { + const std::string& op(vartok->strAt(1)); const bool alwaysTrue = op == "!="; const std::string condition(vartok->str() + op + vartok->strAt(2)); assignIfError(assignTok, tok2, condition, alwaysTrue);