Refactoring; use range for

This commit is contained in:
Daniel Marjamäki 2018-04-24 21:18:36 +02:00
parent b0b08a3bb0
commit 5518247b96
1 changed files with 1 additions and 3 deletions

View File

@ -34,9 +34,7 @@ static const CWE CWE664(664);
void CheckBoost::checkBoostForeachModification()
{
const SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase();
const std::size_t functions = symbolDatabase->functionScopes.size();
for (std::size_t i = 0; i < functions; ++i) {
const Scope * scope = symbolDatabase->functionScopes[i];
for (const Scope * scope : symbolDatabase->functionScopes) {
for (const Token *tok = scope->classStart->next(); tok && tok != scope->classEnd; tok = tok->next()) {
if (!Token::simpleMatch(tok, "BOOST_FOREACH ("))
continue;