Refactoring: use range for loop

This commit is contained in:
Daniel Marjamäki 2018-06-30 15:34:48 +02:00
parent 60ac463a79
commit 4c6270f9b2
1 changed files with 1 additions and 3 deletions

View File

@ -1921,9 +1921,7 @@ void CheckBufferOverrun::arrayIndexThenCheck()
return;
const SymbolDatabase *symbolDatabase = mTokenizer->getSymbolDatabase();
const std::size_t functions = symbolDatabase->functionScopes.size();
for (std::size_t i = 0; i < functions; ++i) {
const Scope * const scope = symbolDatabase->functionScopes[i];
for (const Scope * const scope : symbolDatabase->functionScopes) {
for (const Token *tok = scope->bodyStart; tok && tok != scope->bodyEnd; tok = tok->next()) {
if (Token::simpleMatch(tok, "sizeof (")) {
tok = tok->linkAt(1);