Pre-check to reduce number of match checks
This commit is contained in:
parent
31171f038a
commit
7303790a73
|
@ -188,7 +188,7 @@ void CheckFunctions::checkMathFunctions()
|
||||||
for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) {
|
for (const Token* tok = scope->classStart->next(); tok != scope->classEnd; tok = tok->next()) {
|
||||||
if (tok->varId())
|
if (tok->varId())
|
||||||
continue;
|
continue;
|
||||||
if (printWarnings) {
|
if (printWarnings && Token::Match(tok, "%name% ( !!)")) {
|
||||||
if (tok->strAt(-1) != "."
|
if (tok->strAt(-1) != "."
|
||||||
&& Token::Match(tok, "log|logf|logl|log10|log10f|log10l ( %num% )")) {
|
&& Token::Match(tok, "log|logf|logl|log10|log10f|log10l ( %num% )")) {
|
||||||
const std::string& number = tok->strAt(2);
|
const std::string& number = tok->strAt(2);
|
||||||
|
|
Loading…
Reference in New Issue