Avoided unnecessary usage of symbolDatabase->isClassOrStruct()
This commit is contained in:
parent
5bdb74ca40
commit
ca96aaa53b
|
@ -699,7 +699,7 @@ void CheckClass::initializationListUsage()
|
||||||
}
|
}
|
||||||
if (!allowed)
|
if (!allowed)
|
||||||
continue;
|
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());
|
suggestInitializationList(tok, tok->str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2198,7 +2198,7 @@ void CheckOther::checkConstantFunctionParameter()
|
||||||
passedByValueError(tok, var->name());
|
passedByValueError(tok, var->name());
|
||||||
} else if (Token::Match(tok, "std :: %type% <") && !Token::simpleMatch(tok->linkAt(3), "> ::")) {
|
} else if (Token::Match(tok, "std :: %type% <") && !Token::simpleMatch(tok->linkAt(3), "> ::")) {
|
||||||
passedByValueError(tok, var->name());
|
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());
|
passedByValueError(tok, var->name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue