Clarify code with continue

This commit is contained in:
Daniel Marjamäki 2018-07-20 21:44:23 +02:00
parent 2ae6a84274
commit 417670d947
1 changed files with 4 additions and 4 deletions

View File

@ -1360,8 +1360,8 @@ static bool canBeConst(const Variable *var)
const Token* parent = tok2->astParent(); const Token* parent = tok2->astParent();
if (!parent) if (!parent)
; continue;
else if (parent->str() == "<<" || isLikelyStreamRead(true, parent)) { if (parent->str() == "<<" || isLikelyStreamRead(true, parent)) {
if (parent->str() == "<<" && parent->astOperand1() == tok2) if (parent->str() == "<<" && parent->astOperand1() == tok2)
return false; return false;
if (parent->str() == ">>" && parent->astOperand2() == tok2) if (parent->str() == ">>" && parent->astOperand2() == tok2)
@ -1391,7 +1391,7 @@ static bool canBeConst(const Variable *var)
// TODO: check how pointer is used // TODO: check how pointer is used
return false; return false;
} else if (parent->isConstOp()) } else if (parent->isConstOp())
; continue;
else if (parent->isAssignmentOp()) { else if (parent->isAssignmentOp()) {
if (parent->astOperand1() == tok2) if (parent->astOperand1() == tok2)
return false; return false;
@ -1403,7 +1403,7 @@ static bool canBeConst(const Variable *var)
} else if (Token::Match(tok2, "%var% . %name% (")) { } else if (Token::Match(tok2, "%var% . %name% (")) {
const Function* func = tok2->tokAt(2)->function(); const Function* func = tok2->tokAt(2)->function();
if (func && (func->isConst() || func->isStatic())) if (func && (func->isConst() || func->isStatic()))
; continue;
else else
return false; return false;
} else } else