From 7da6ce8704080126ad380c284a080b9080ea19a8 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Tue, 8 Jul 2014 12:28:57 +0400 Subject: [PATCH] Omit unnecessary checks --- lib/checkclass.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index c40107b07..f02ba6c59 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -135,8 +135,10 @@ void CheckClass::constructors() unsigned int count = 0; for (var = scope->varlist.begin(); var != scope->varlist.end(); ++var, ++count) { // check for C++11 initializer - if (var->hasDefault()) + if (var->hasDefault()) { usage[count].init = true; + continue; + } if (usage[count].assign || usage[count].init || var->isStatic()) continue; @@ -994,7 +996,7 @@ void CheckClass::checkMemset() for (const Token *typetok2 = var->typeStartToken(); typetok2 && typetok2 != var->typeEndToken(); typetok2 = typetok2->next()) { if (typetok2->str() == "::") bailout = true; - if (typetok2->str() == "{") { + else if (typetok2->str() == "{") { bailout = false; break; }