From 5b1d96b3468b0e9ae4e5708883c040bbc271a032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 14 Jul 2018 08:04:08 +0200 Subject: [PATCH] Clarify code with Token::isUnaryOp() --- lib/checkcondition.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/checkcondition.cpp b/lib/checkcondition.cpp index cf1ddc97c..ac9621b75 100644 --- a/lib/checkcondition.cpp +++ b/lib/checkcondition.cpp @@ -643,7 +643,7 @@ void CheckCondition::multiCondition2() break; if (Token::Match(tok->astParent(), "*|.|[")) { const Token *parent = tok; - while (Token::Match(parent->astParent(), ".|[") || (Token::simpleMatch(parent->astParent(), "*") && !parent->astParent()->astOperand2())) + while (Token::Match(parent->astParent(), ".|[") || (parent->astParent() && parent->astParent()->isUnaryOp("*"))) parent = parent->astParent(); if (Token::Match(parent->astParent(), "%assign%|++|--")) break; @@ -1138,7 +1138,7 @@ void CheckCondition::clarifyCondition() } else if (!tok2->isName() && !tok2->isNumber() && tok2->str() != ".") break; } - } else if (tok->tokType() == Token::eBitOp && (tok->str() != "&" || tok->astOperand2())) { + } else if (tok->tokType() == Token::eBitOp && !tok->isUnaryOp("&")) { if (tok->astOperand2() && tok->astOperand2()->variable() && tok->astOperand2()->variable()->nameToken() == tok->astOperand2()) continue;