From b1e9d9b86f0c71ab69077d4ba47d927ec83f3006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Tue, 17 Feb 2015 19:32:59 +0100 Subject: [PATCH] Coverity CID 1270450: Removed redundant conditions --- lib/checkuninitvar.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/checkuninitvar.cpp b/lib/checkuninitvar.cpp index e66c9f310..2ed4adcf1 100644 --- a/lib/checkuninitvar.cpp +++ b/lib/checkuninitvar.cpp @@ -1498,16 +1498,13 @@ bool CheckUninitVar::checkScopeForVariable(const Token *tok, const Variable& var Token::Match(tok->next(), "= %name% (") && Token::simpleMatch(tok->linkAt(3), ") ;") && _settings->library.returnuninitdata.count(tok->strAt(2)) > 0U) { - if (alloc) - *alloc = NO_CTOR_CALL; + *alloc = NO_CTOR_CALL; continue; } if (var.isPointer() && (var.typeStartToken()->isStandardType() || (var.type() && var.type()->needInitialization == Type::True)) && Token::simpleMatch(tok->next(), "= new")) { - if (alloc) { - *alloc = CTOR_CALL; - if (var.typeScope() && var.typeScope()->numConstructors > 0) - return true; - } + *alloc = CTOR_CALL; + if (var.typeScope() && var.typeScope()->numConstructors > 0) + return true; continue; }