From c7987ad11ad166eff732021936bf1ea5d84bb605 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Mon, 9 Nov 2015 11:12:22 +0100 Subject: [PATCH] Refactorization: Removed redundant nullptr checks. The existence of the tokens is guaranteed by previous Token::Match() call --- lib/checkother.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 98720b879..1f811bde4 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -258,9 +258,7 @@ void CheckOther::warningOldStylePointerCast() // skip first "const" in "const Type* const" if (tok->strAt(1) == "const") tok = tok->next(); - const Token* typeTok = tok ? tok->next() : nullptr; - if (!typeTok) - continue; + const Token* typeTok = tok->next(); // skip second "const" in "const Type* const" if (tok->strAt(3) == "const") tok = tok->next();