Refactoring, use continue in loop

This commit is contained in:
Daniel Marjamäki 2017-07-30 14:53:58 +02:00
parent 65f5e219f1
commit fec0c46af0
1 changed files with 22 additions and 22 deletions

View File

@ -1198,7 +1198,8 @@ void CheckBufferOverrun::checkGlobalAndLocalVariable()
for (std::list<Scope>::const_iterator scope = symbolDatabase->scopeList.cbegin(); scope != symbolDatabase->scopeList.cend(); ++scope) {
std::map<unsigned int, ArrayInfo> arrayInfos;
for (std::list<Variable>::const_iterator var = scope->varlist.cbegin(); var != scope->varlist.cend(); ++var) {
if (var->isArray() && var->dimension(0) > 0) {
if (!var->isArray() || var->dimension(0) <= 0)
continue;
_errorLogger->reportProgress(_tokenizer->list.getSourceFilePath(),
"Check (BufferOverrun::checkGlobalAndLocalVariable 1)",
var->nameToken()->progressValue());
@ -1222,7 +1223,6 @@ void CheckBufferOverrun::checkGlobalAndLocalVariable()
tok = tok->next();
arrayInfos[var->declarationId()] = ArrayInfo(&*var, symbolDatabase, var->declarationId());
}
}
if (!arrayInfos.empty())
checkScope(scope->classStart ? scope->classStart : _tokenizer->tokens(), arrayInfos);
}