Skip to content

Commit 392f09e

Browse files
committed
Simplify
1 parent 73f8b9c commit 392f09e

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

lib/checkother.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3342,9 +3342,7 @@ static bool checkVariableAssignment(const Token* tok, const Settings& settings)
33423342
const Scope* scope = tok->scope();
33433343
while (scope && scope->type != ScopeType::eFunction)
33443344
scope = scope->nestedIn;
3345-
if (!scope || !scope->function || (scope->functionOf && !scope->function->isConst() && !scope->function->isStatic()))
3346-
return false;
3347-
return true;
3345+
return scope && scope->function && (!scope->functionOf || scope->function->isConst() || scope->function->isStatic());
33483346
}
33493347

33503348
void CheckOther::checkRedundantCopy()

0 commit comments

Comments
 (0)