Refactoring; shorter code

This commit is contained in:
Daniel Marjamäki 2019-11-16 11:20:14 +01:00
parent 754c1fff66
commit 7f57c980f0
1 changed files with 2 additions and 6 deletions

View File

@ -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;
}