Avoid recomputing loop range end

This commit is contained in:
Dmitry-Me 2017-10-14 18:57:27 +03:00
parent db787369b9
commit 288ee96cc7
1 changed files with 2 additions and 1 deletions

View File

@ -159,7 +159,8 @@ void CheckSizeof::checkSizeofForPointerSize()
tokSize = tokSize->nextArgument();
if (tokFunc && tokSize) {
for (const Token* tok2 = tokSize; tok2 != tokFunc->linkAt(1); tok2 = tok2->next()) {
const Token * const paramsListEndTok = tokFunc->linkAt(1);
for (const Token* tok2 = tokSize; tok2 != paramsListEndTok; tok2 = tok2->next()) {
if (Token::simpleMatch(tok2, "/ sizeof")) {
// Allow division with sizeof(char)
if (Token::simpleMatch(tok2->next(), "sizeof (")) {