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