astutils.cpp: Removed useless parentheses
This commit is contained in:
parent
3dfe9eff3e
commit
c24edc528e
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue