Revert "tokenlist::iscast(): save a few pointer dereferences."

This reverts commit e187fdb696.
This commit is contained in:
Matthias Krüger 2018-06-02 15:57:56 +02:00
parent d3b231214d
commit 0771a81969
1 changed files with 3 additions and 4 deletions

View File

@ -391,11 +391,10 @@ static bool iscast(const Token *tok)
if (!Token::Match(tok, "( ::| %name%"))
return false;
const Token *prevTok = tok->previous();
if (prevTok && prevTok->isName() && prevTok->str() != "return")
if (tok->previous() && tok->previous()->isName() && tok->previous()->str() != "return")
return false;
if (Token::simpleMatch(prevTok, ">") && prevTok->link())
if (Token::simpleMatch(tok->previous(), ">") && tok->previous()->link())
return false;
if (Token::Match(tok, "( (| typeof (") && Token::Match(tok->link(), ") %num%"))
@ -407,7 +406,7 @@ static bool iscast(const Token *tok)
if (Token::Match(tok->link(), ") %cop%") && !Token::Match(tok->link(), ") [&*+-~]"))
return false;
if (Token::Match(prevTok, "= ( %name% ) {") && tok->next()->varId() == 0)
if (Token::Match(tok->previous(), "= ( %name% ) {") && tok->next()->varId() == 0)
return true;
bool type = false;