From ca96aaa53b44e266a76aecd6c69b609a7983bf30 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Tue, 5 Mar 2013 06:55:31 -0800 Subject: [PATCH] Avoided unnecessary usage of symbolDatabase->isClassOrStruct() --- lib/checkclass.cpp | 2 +- lib/checkother.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index c7f129cff..618f7edd7 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -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()); } } diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 114b98fa1..041b3a5c2 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -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()); } }