Cache and reuse previously computed value

This commit is contained in:
Dmitry-Me 2014-11-30 13:00:27 +01:00 committed by Daniel Marjamäki
parent 5e37275b2a
commit 6482fefe3e
1 changed files with 3 additions and 2 deletions

View File

@ -1226,8 +1226,9 @@ bool SymbolDatabase::isFunction(const Token *tok, const Scope* outerScope, const
tok->link()->previous()->str() == ")") {
const Token* tok2 = tok->link()->next();
if (tok2 && tok2->str() == "(" && Token::Match(tok2->link()->next(), "{|;|const|=")) {
*funcStart = tok->link()->previous()->link()->previous();
*argStart = tok->link()->previous()->link();
const Token* argStartTok = tok->link()->previous()->link();
*funcStart = argStartTok->previous();
*argStart = argStartTok;
return true;
}
}