Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Mar 21, 2024
1 parent a463699 commit 926f99b
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions lib/checkunusedvar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,17 +713,12 @@ void CheckUnusedVar::checkFunctionVariableUsage_iterateScopes(const Scope* const
type = Variables::pointer;
else if (mTokenizer->isC() ||
i->typeEndToken()->isStandardType() ||
i->isStlType())
i->isStlType() ||
isRecordTypeWithoutSideEffects(i->type()) ||
mSettings->library.detectContainer(i->typeStartToken()) ||
mSettings->library.getTypeCheck("unusedvar", i->typeStartToken()->str()) == Library::TypeCheck::check)
type = Variables::standard;
else {
if (isRecordTypeWithoutSideEffects(i->type()) || mSettings->library.detectContainer(i->typeStartToken()))
type = Variables::standard;
else {
Library::TypeCheck typeCheck = mSettings->library.getTypeCheck("unusedvar", i->typeStartToken()->str());
if (typeCheck == Library::TypeCheck::check)
type = Variables::standard;
}
}

if (type == Variables::none || isPartOfClassStructUnion(i->typeStartToken()))
continue;
const Token* defValTok = i->nameToken()->next();
Expand Down

0 comments on commit 926f99b

Please sign in to comment.