Refactoring; Reuse variable typeSize

This commit is contained in:
Daniel Marjamäki 2020-01-19 09:17:38 +01:00
parent a6ab986217
commit 84bb024662
1 changed files with 2 additions and 2 deletions

View File

@ -214,10 +214,10 @@ static bool getDimensionsEtc(const Token * const arrayToken, const Settings *set
Dimension dim;
dim.known = value->isKnown();
dim.tok = nullptr;
int typeSize = array->valueType()->typeSize(*settings);
const int typeSize = array->valueType()->typeSize(*settings);
if (typeSize == 0)
return false;
dim.num = value->intvalue / array->valueType()->typeSize(*settings);
dim.num = value->intvalue / typeSize;
dimensions->emplace_back(dim);
}
return !dimensions->empty();