Skip to content

Commit 6482fef

Browse files
Dmitry-Medanmar
authored andcommitted
Cache and reuse previously computed value
1 parent 5e37275 commit 6482fef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/symboldatabase.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,8 +1226,9 @@ bool SymbolDatabase::isFunction(const Token *tok, const Scope* outerScope, const
12261226
tok->link()->previous()->str() == ")") {
12271227
const Token* tok2 = tok->link()->next();
12281228
if (tok2 && tok2->str() == "(" && Token::Match(tok2->link()->next(), "{|;|const|=")) {
1229-
*funcStart = tok->link()->previous()->link()->previous();
1230-
*argStart = tok->link()->previous()->link();
1229+
const Token* argStartTok = tok->link()->previous()->link();
1230+
*funcStart = argStartTok->previous();
1231+
*argStart = argStartTok;
12311232
return true;
12321233
}
12331234
}

0 commit comments

Comments
 (0)