Avoided unnecessary usage of symbolDatabase->isClassOrStruct()

This commit is contained in:
PKEuS 2013-03-05 06:55:31 -08:00
parent 5bdb74ca40
commit ca96aaa53b
2 changed files with 2 additions and 2 deletions

View File

@ -699,7 +699,7 @@ void CheckClass::initializationListUsage()
}
if (!allowed)
continue;
if (!var->isPointer() && (var->type() || Token::Match(var->typeStartToken(), "std :: string|wstring !!::") || (Token::Match(var->typeStartToken(), "std :: %type% <") && !Token::simpleMatch(var->typeStartToken()->linkAt(3), "> ::")) || symbolDatabase->isClassOrStruct(var->typeStartToken()->str())))
if (!var->isPointer() && (var->type() || Token::Match(var->typeStartToken(), "std :: string|wstring !!::") || (Token::Match(var->typeStartToken(), "std :: %type% <") && !Token::simpleMatch(var->typeStartToken()->linkAt(3), "> ::"))))
suggestInitializationList(tok, tok->str());
}
}

View File

@ -2198,7 +2198,7 @@ void CheckOther::checkConstantFunctionParameter()
passedByValueError(tok, var->name());
} else if (Token::Match(tok, "std :: %type% <") && !Token::simpleMatch(tok->linkAt(3), "> ::")) {
passedByValueError(tok, var->name());
} else if (var->type() || symbolDatabase->isClassOrStruct(tok->str())) { // Check if type is a struct or class.
} else if (var->type()) { // Check if type is a struct or class.
passedByValueError(tok, var->name());
}
}