Refactoring: Use range for
This commit is contained in:
parent
56c47fc6ed
commit
a1ade2dd7d
|
@ -1261,14 +1261,13 @@ void SymbolDatabase::createSymbolDatabaseEnums()
|
||||||
void SymbolDatabase::createSymbolDatabaseUnknownArrayDimensions()
|
void SymbolDatabase::createSymbolDatabaseUnknownArrayDimensions()
|
||||||
{
|
{
|
||||||
// set all unknown array dimensions
|
// set all unknown array dimensions
|
||||||
for (std::size_t i = 1; i <= mTokenizer->varIdCount(); i++) {
|
for (const Variable *var : mVariableList) {
|
||||||
// check each array variable
|
// check each array variable
|
||||||
if (!mVariableList[i] || !mVariableList[i]->isArray())
|
if (!var || !var->isArray())
|
||||||
continue;
|
continue;
|
||||||
// check each array dimension
|
// check each array dimension
|
||||||
const std::vector<Dimension>& dimensions = mVariableList[i]->dimensions();
|
for (const Dimension &const_dimension : var->dimensions()) {
|
||||||
for (std::size_t j = 0; j < dimensions.size(); j++) {
|
Dimension &dimension = const_cast<Dimension &>(const_dimension);
|
||||||
Dimension &dimension = const_cast<Dimension &>(dimensions[j]);
|
|
||||||
if (dimension.num != 0)
|
if (dimension.num != 0)
|
||||||
continue;
|
continue;
|
||||||
dimension.known = false;
|
dimension.known = false;
|
||||||
|
|
Loading…
Reference in New Issue