Refactoring; shorter code
This commit is contained in:
parent
754c1fff66
commit
7f57c980f0
|
@ -734,13 +734,9 @@ bool CheckUninitVar::checkScopeForVariable(const Token *tok, const Variable& var
|
|||
return true;
|
||||
|
||||
// array new
|
||||
if (Token::Match(tok->next(), "= new %type% [")) {
|
||||
const Token* tokClosingBracket=tok->linkAt(4);
|
||||
// array new with initialization
|
||||
if (tokClosingBracket && Token::simpleMatch(tokClosingBracket->next(), "( )"))
|
||||
if (Token::Match(tok->next(), "= new %type% [") && Token::simpleMatch(tok->linkAt(4), "] ("))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue