From 4663dc205aed99090bd2f6da2dc15c18e3041e6b Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Fri, 1 Sep 2017 18:16:08 +0300 Subject: [PATCH] Cache and reuse value --- lib/valueflow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index eec4c0566..3ec37778d 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -1995,8 +1995,9 @@ static bool isStdMoveOrStdForwarded(Token * tok, ValueFlow::Value::MoveKind * mo static bool isOpenParenthesisMemberFunctionCallOfVarId(const Token * openParenthesisToken, unsigned int varId) { - return Token::Match(openParenthesisToken->tokAt(-3),"%varid% . %name% (", varId) && - openParenthesisToken->tokAt(-2)->originalName() == emptyString; + const Token * varTok = openParenthesisToken->tokAt(-3); + return Token::Match(varTok, "%varid% . %name% (", varId) && + varTok->next()->originalName() == emptyString; } static const Token * nextAfterAstRightmostLeaf(Token const * tok)