From 0771a81969ee552aad1cadd28b9c039cbf208871 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 2 Jun 2018 15:57:56 +0200 Subject: [PATCH] Revert "tokenlist::iscast(): save a few pointer dereferences." This reverts commit e187fdb696d56458bd7312e666e4e2313cf00a8f. --- lib/tokenlist.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index d691d0e62..3dd793ec9 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -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;