Skip to content

Commit

Permalink
Fix loop
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Jan 6, 2024
1 parent 453dcee commit af29efb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/checkclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2664,7 +2664,7 @@ void CheckClass::initializerListOrder()
tok = tok->next();

// find all variable initializations in list
while (tok && tok != func->functionScope->bodyStart) {
for (; tok && tok != func->functionScope->bodyStart; tok = tok->next()) {
if (Token::Match(tok, "%name% (|{")) {
const Variable *var = scope->getVariable(tok->str());
if (var)
Expand All @@ -2677,9 +2677,8 @@ void CheckClass::initializerListOrder()
if (auto var2 = tok2->variable())
vars.back().initArgs.emplace_back(var2);
}
tok = end->next();
} else
tok = tok->next();
tok = end;
}
}

for (int j = 0; j < vars.size(); j++) {
Expand Down

0 comments on commit af29efb

Please sign in to comment.