Refactoring; use early continue

This commit is contained in:
Daniel Marjamäki 2018-06-23 23:26:37 +02:00
parent 655a8b21b6
commit 2beeca3ca2
1 changed files with 51 additions and 50 deletions

View File

@ -1355,7 +1355,9 @@ static std::size_t estimateSize(const Type* type, const Settings* settings, cons
static bool canBeConst(const Variable *var)
{
for (const Token* tok2 = var->scope()->bodyStart; tok2 != var->scope()->bodyEnd; tok2 = tok2->next()) {
if (tok2->varId() == var->declarationId()) {
if (tok2->varId() != var->declarationId())
continue;
const Token* parent = tok2->astParent();
if (!parent)
;
@ -1407,7 +1409,6 @@ static bool canBeConst(const Variable *var)
} else
return false;
}
}
return true;
}