Omit unnecessary checks

This commit is contained in:
Dmitry-Me 2014-07-08 12:28:57 +04:00
parent 9a4bd73a18
commit 7da6ce8704
1 changed files with 4 additions and 2 deletions

View File

@ -135,8 +135,10 @@ void CheckClass::constructors()
unsigned int count = 0; unsigned int count = 0;
for (var = scope->varlist.begin(); var != scope->varlist.end(); ++var, ++count) { for (var = scope->varlist.begin(); var != scope->varlist.end(); ++var, ++count) {
// check for C++11 initializer // check for C++11 initializer
if (var->hasDefault()) if (var->hasDefault()) {
usage[count].init = true; usage[count].init = true;
continue;
}
if (usage[count].assign || usage[count].init || var->isStatic()) if (usage[count].assign || usage[count].init || var->isStatic())
continue; continue;
@ -994,7 +996,7 @@ void CheckClass::checkMemset()
for (const Token *typetok2 = var->typeStartToken(); typetok2 && typetok2 != var->typeEndToken(); typetok2 = typetok2->next()) { for (const Token *typetok2 = var->typeStartToken(); typetok2 && typetok2 != var->typeEndToken(); typetok2 = typetok2->next()) {
if (typetok2->str() == "::") if (typetok2->str() == "::")
bailout = true; bailout = true;
if (typetok2->str() == "{") { else if (typetok2->str() == "{") {
bailout = false; bailout = false;
break; break;
} }