Refactoring, use continue in loop
This commit is contained in:
parent
65f5e219f1
commit
fec0c46af0
|
@ -1198,7 +1198,8 @@ void CheckBufferOverrun::checkGlobalAndLocalVariable()
|
||||||
for (std::list<Scope>::const_iterator scope = symbolDatabase->scopeList.cbegin(); scope != symbolDatabase->scopeList.cend(); ++scope) {
|
for (std::list<Scope>::const_iterator scope = symbolDatabase->scopeList.cbegin(); scope != symbolDatabase->scopeList.cend(); ++scope) {
|
||||||
std::map<unsigned int, ArrayInfo> arrayInfos;
|
std::map<unsigned int, ArrayInfo> arrayInfos;
|
||||||
for (std::list<Variable>::const_iterator var = scope->varlist.cbegin(); var != scope->varlist.cend(); ++var) {
|
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(),
|
_errorLogger->reportProgress(_tokenizer->list.getSourceFilePath(),
|
||||||
"Check (BufferOverrun::checkGlobalAndLocalVariable 1)",
|
"Check (BufferOverrun::checkGlobalAndLocalVariable 1)",
|
||||||
var->nameToken()->progressValue());
|
var->nameToken()->progressValue());
|
||||||
|
@ -1222,7 +1223,6 @@ void CheckBufferOverrun::checkGlobalAndLocalVariable()
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
arrayInfos[var->declarationId()] = ArrayInfo(&*var, symbolDatabase, var->declarationId());
|
arrayInfos[var->declarationId()] = ArrayInfo(&*var, symbolDatabase, var->declarationId());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!arrayInfos.empty())
|
if (!arrayInfos.empty())
|
||||||
checkScope(scope->classStart ? scope->classStart : _tokenizer->tokens(), arrayInfos);
|
checkScope(scope->classStart ? scope->classStart : _tokenizer->tokens(), arrayInfos);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue