Refactoring: Use range for loop
This commit is contained in:
parent
46bb63ceaf
commit
3fdb2da0d1
|
@ -49,9 +49,7 @@ void Check64BitPortability::pointerassignment()
|
||||||
const SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase();
|
const SymbolDatabase *symbolDatabase = _tokenizer->getSymbolDatabase();
|
||||||
|
|
||||||
// Check return values
|
// Check return values
|
||||||
const std::size_t functions = symbolDatabase->functionScopes.size();
|
for (const Scope * scope : symbolDatabase->functionScopes) {
|
||||||
for (std::size_t i = 0; i < functions; ++i) {
|
|
||||||
const Scope * scope = symbolDatabase->functionScopes[i];
|
|
||||||
if (scope->function == nullptr || !scope->function->hasBody()) // We only look for functions with a body
|
if (scope->function == nullptr || !scope->function->hasBody()) // We only look for functions with a body
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -89,8 +87,7 @@ void Check64BitPortability::pointerassignment()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check assignments
|
// Check assignments
|
||||||
for (std::size_t i = 0; i < functions; ++i) {
|
for (const Scope * scope : symbolDatabase->functionScopes) {
|
||||||
const Scope * scope = symbolDatabase->functionScopes[i];
|
|
||||||
for (const Token *tok = scope->classStart; tok && tok != scope->classEnd; tok = tok->next()) {
|
for (const Token *tok = scope->classStart; tok && tok != scope->classEnd; tok = tok->next()) {
|
||||||
if (tok->str() != "=")
|
if (tok->str() != "=")
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue