small CheckStl optimization (#3645)

This commit is contained in:
Oliver Stöneberg 2021-12-20 07:29:45 +01:00 committed by GitHub
parent 73f24b43f9
commit 38de9214a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -2870,6 +2870,9 @@ void CheckStl::localMutexError(const Token* tok)
void CheckStl::checkMutexes()
{
if (!mSettings->severity.isEnabled(Severity::warning))
return;
for (const Scope *function : mTokenizer->getSymbolDatabase()->functionScopes) {
std::set<nonneg int> checkedVars;
for (const Token *tok = function->bodyStart; tok != function->bodyEnd; tok = tok->next()) {

View File

@ -63,7 +63,6 @@ public:
checkStl.if_find();
checkStl.checkFindInsert();
checkStl.iterators();
checkStl.mismatchingContainers();
checkStl.missingComparison();
checkStl.outOfBounds();
checkStl.outOfBoundsIndexExpression();