astutils.cpp: Removed useless parentheses

This commit is contained in:
orbitcowboy 2022-06-03 00:18:35 +02:00
parent 3dfe9eff3e
commit c24edc528e
1 changed files with 2 additions and 2 deletions

View File

@ -2225,7 +2225,7 @@ bool isVariableChanged(const Token *tok, int indirect, const Settings *settings,
derefs++; derefs++;
if (derefs > indirect) if (derefs > indirect)
break; break;
if ((tok2->astParent() && tok2->astParent()->isUnaryOp("&") && Token::simpleMatch(tok2->astParent()->astParent(), ".") && tok2->astParent()->astParent()->originalName()=="->")) if (tok2->astParent() && tok2->astParent()->isUnaryOp("&") && Token::simpleMatch(tok2->astParent()->astParent(), ".") && tok2->astParent()->astParent()->originalName()=="->")
tok2 = tok2->astParent(); tok2 = tok2->astParent();
tok2 = tok2->astParent(); tok2 = tok2->astParent();
} }
@ -2238,7 +2238,7 @@ bool isVariableChanged(const Token *tok, int indirect, const Settings *settings,
auto skipRedundantPtrOp = [](const Token* tok, const Token* parent) { auto skipRedundantPtrOp = [](const Token* tok, const Token* parent) {
const Token* gparent = parent ? parent->astParent() : nullptr; const Token* gparent = parent ? parent->astParent() : nullptr;
while (parent && gparent && ((parent->isUnaryOp("*") && gparent->isUnaryOp("&")) || ((parent->isUnaryOp("&") && gparent->isUnaryOp("*"))))) { while (parent && gparent && ((parent->isUnaryOp("*") && gparent->isUnaryOp("&")) || (parent->isUnaryOp("&") && gparent->isUnaryOp("*")))) {
tok = gparent; tok = gparent;
parent = gparent->astParent(); parent = gparent->astParent();
if (parent) if (parent)