Refactoring; use early continue
This commit is contained in:
parent
655a8b21b6
commit
2beeca3ca2
|
@ -1355,7 +1355,9 @@ static std::size_t estimateSize(const Type* type, const Settings* settings, cons
|
||||||
static bool canBeConst(const Variable *var)
|
static bool canBeConst(const Variable *var)
|
||||||
{
|
{
|
||||||
for (const Token* tok2 = var->scope()->bodyStart; tok2 != var->scope()->bodyEnd; tok2 = tok2->next()) {
|
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();
|
const Token* parent = tok2->astParent();
|
||||||
if (!parent)
|
if (!parent)
|
||||||
;
|
;
|
||||||
|
@ -1407,7 +1409,6 @@ static bool canBeConst(const Variable *var)
|
||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue