From 1a2b770bfd57ccc62ec31dd93c028e3a51da2064 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Tue, 31 Dec 2019 18:32:45 +0300 Subject: [PATCH] Break the loop once a match is found --- lib/checkclass.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index ddd857b3a..398b844db 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -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);