From 7f57c980f099147fa4d2dbaeb1e44af4b2981a8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Sat, 16 Nov 2019 11:20:14 +0100 Subject: [PATCH] Refactoring; shorter code --- lib/checkuninitvar.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/checkuninitvar.cpp b/lib/checkuninitvar.cpp index d17a66beb..2f707140c 100644 --- a/lib/checkuninitvar.cpp +++ b/lib/checkuninitvar.cpp @@ -734,12 +734,8 @@ 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(), "( )")) - return true; - } + if (Token::Match(tok->next(), "= new %type% [") && Token::simpleMatch(tok->linkAt(4), "] (")) + return true; } continue;