token.cpp: optimized Token::multiCompare() a bit - reduces average Ir from 71 to 63 when scanning test folder (#3525)

This commit is contained in:
Oliver Stöneberg 2021-10-26 08:57:54 +02:00 committed by GitHub
parent 1f01845efb
commit ce029f3ea7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -555,11 +555,14 @@ int Token::multiCompare(const Token *tok, const char *haystack, nonneg int varid
do {
++haystack;
} while (*haystack != ' ' && *haystack != '|' && *haystack);
if (*haystack == ' ' || *haystack == '\0') {
return -1;
}
if (*haystack == '|') {
break;
}
} while (true);
++haystack;
}