Refactoring: Use range for loop

This commit is contained in:
Daniel Marjamäki 2018-04-20 22:10:29 +02:00
parent 46bb63ceaf
commit 3fdb2da0d1
1 changed files with 2 additions and 5 deletions

View File

@ -49,9 +49,7 @@ void Check64BitPortability::pointerassignment()
const SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase();
// Check return values
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) {
if (scope->function == nullptr || !scope->function->hasBody()) // We only look for functions with a body
continue;
@ -89,8 +87,7 @@ void Check64BitPortability::pointerassignment()
}
// Check assignments
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; tok && tok != scope->classEnd; tok = tok->next()) {
if (tok->str() != "=")
continue;