Cache and reuse value

This commit is contained in:
Dmitry-Me 2017-10-23 00:36:05 +03:00
parent 539258f7a3
commit 46f726c049
1 changed files with 6 additions and 3 deletions

View File

@ -1153,9 +1153,12 @@ void Tokenizer::simplifyTypedef()
int back = int(classLevel) - 1; int back = int(classLevel) - 1;
bool good = true; bool good = true;
// check for extra qualification // check for extra qualification
while (back >= 0 && Token::Match(start->tokAt(-2), "%type% ::")) { while (back >= 0) {
if (start->strAt(-2) == spaceInfo[back].className) { const Token *qualificationTok = start->tokAt(-2);
start = start->tokAt(-2); if (!Token::Match(qualificationTok, "%type% ::")
break;
if (qualificationTok->str() == spaceInfo[back].className) {
start = qualificationTok;
back--; back--;
count++; count++;
} else { } else {