Refactorization: Removed redundant nullptr checks. The existence of the tokens is guaranteed by previous Token::Match() call

This commit is contained in:
PKEuS 2015-11-09 11:12:22 +01:00
parent 5074c11b53
commit c7987ad11a
1 changed files with 1 additions and 3 deletions

View File

@ -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();