File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -391,10 +391,11 @@ static bool iscast(const Token *tok)
391391 if (!Token::Match (tok, " ( ::| %name%" ))
392392 return false ;
393393
394- if (tok->previous () && tok->previous ()->isName () && tok->previous ()->str () != " return" )
394+ const Token *prevTok = tok->previous ();
395+ if (prevTok && prevTok->isName () && prevTok->str () != " return" )
395396 return false ;
396397
397- if (Token::simpleMatch (tok-> previous () , " >" ) && tok-> previous () ->link ())
398+ if (Token::simpleMatch (prevTok , " >" ) && prevTok ->link ())
398399 return false ;
399400
400401 if (Token::Match (tok, " ( (| typeof (" ) && Token::Match (tok->link (), " ) %num%" ))
@@ -406,7 +407,7 @@ static bool iscast(const Token *tok)
406407 if (Token::Match (tok->link (), " ) %cop%" ) && !Token::Match (tok->link (), " ) [&*+-~]" ))
407408 return false ;
408409
409- if (Token::Match (tok-> previous () , " = ( %name% ) {" ) && tok->next ()->varId () == 0 )
410+ if (Token::Match (prevTok , " = ( %name% ) {" ) && tok->next ()->varId () == 0 )
410411 return true ;
411412
412413 bool type = false ;
You can’t perform that action at this time.
0 commit comments