Skip to content

Commit 0771a81

Browse files
committed
Revert "tokenlist::iscast(): save a few pointer dereferences."
This reverts commit e187fdb.
1 parent d3b2312 commit 0771a81

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lib/tokenlist.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,11 +391,10 @@ static bool iscast(const Token *tok)
391391
if (!Token::Match(tok, "( ::| %name%"))
392392
return false;
393393

394-
const Token *prevTok = tok->previous();
395-
if (prevTok && prevTok->isName() && prevTok->str() != "return")
394+
if (tok->previous() && tok->previous()->isName() && tok->previous()->str() != "return")
396395
return false;
397396

398-
if (Token::simpleMatch(prevTok, ">") && prevTok->link())
397+
if (Token::simpleMatch(tok->previous(), ">") && tok->previous()->link())
399398
return false;
400399

401400
if (Token::Match(tok, "( (| typeof (") && Token::Match(tok->link(), ") %num%"))
@@ -407,7 +406,7 @@ static bool iscast(const Token *tok)
407406
if (Token::Match(tok->link(), ") %cop%") && !Token::Match(tok->link(), ") [&*+-~]"))
408407
return false;
409408

410-
if (Token::Match(prevTok, "= ( %name% ) {") && tok->next()->varId() == 0)
409+
if (Token::Match(tok->previous(), "= ( %name% ) {") && tok->next()->varId() == 0)
411410
return true;
412411

413412
bool type = false;

0 commit comments

Comments
 (0)