Break the loop once a match is found

This commit is contained in:
Dmitry-Me 2019-12-31 18:32:45 +03:00
parent 895910b769
commit 1a2b770bfd
1 changed files with 3 additions and 1 deletions

View File

@ -383,8 +383,10 @@ void CheckClass::copyconstructors()
break;
}
const Variable *var = it->second->variable();
if (var && var->typeScope() && var->typeScope()->functionList.empty() && var->type()->derivedFrom.empty())
if (var && var->typeScope() && var->typeScope()->functionList.empty() && var->type()->derivedFrom.empty()) {
mustDealloc = it->second;
break;
}
}
if (mustDealloc)
noDestructorError(scope, funcDestructor, mustDealloc);