Refactoring: Use range for

This commit is contained in:
Daniel Marjamäki 2019-03-14 19:57:58 +01:00
parent 56c47fc6ed
commit a1ade2dd7d
1 changed files with 4 additions and 5 deletions

View File

@ -1261,14 +1261,13 @@ void SymbolDatabase::createSymbolDatabaseEnums()
void SymbolDatabase::createSymbolDatabaseUnknownArrayDimensions()
{
// set all unknown array dimensions
for (std::size_t i = 1; i <= mTokenizer->varIdCount(); i++) {
for (const Variable *var : mVariableList) {
// check each array variable
if (!mVariableList[i] || !mVariableList[i]->isArray())
if (!var || !var->isArray())
continue;
// check each array dimension
const std::vector<Dimension>& dimensions = mVariableList[i]->dimensions();
for (std::size_t j = 0; j < dimensions.size(); j++) {
Dimension &dimension = const_cast<Dimension &>(dimensions[j]);
for (const Dimension &const_dimension : var->dimensions()) {
Dimension &dimension = const_cast<Dimension &>(const_dimension);
if (dimension.num != 0)
continue;
dimension.known = false;