summaryrefslogtreecommitdiff
path: root/include/o3tl/unit_conversion.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'include/o3tl/unit_conversion.hxx')
-rw-r--r--include/o3tl/unit_conversion.hxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/o3tl/unit_conversion.hxx b/include/o3tl/unit_conversion.hxx
index 17dd5ae12293..e43ecb557789 100644
--- a/include/o3tl/unit_conversion.hxx
+++ b/include/o3tl/unit_conversion.hxx
@@ -178,16 +178,16 @@ constexpr m_and_d mdBaseLen[] = {
static_assert(SAL_N_ELEMENTS(mdBaseLen) == static_cast<int>(Length::count),
"mdBaseL must have an entry for each unit in o3tl::Length");
+// The resulting multipliers and divisors array
+constexpr auto aLengthMDArray = prepareMDArray(mdBaseLen);
+
// an overload taking Length
constexpr sal_Int64 md(Length i, Length j)
{
- // The resulting multipliers and divisors array
- constexpr auto aMDArray = prepareMDArray(mdBaseLen);
-
const int nI = static_cast<int>(i), nJ = static_cast<int>(j);
- assert(nI >= 0 && o3tl::make_unsigned(nI) < aMDArray.size());
- assert(nJ >= 0 && o3tl::make_unsigned(nJ) < aMDArray.size());
- return aMDArray[nI][nJ];
+ assert(nI >= 0 && o3tl::make_unsigned(nI) < aLengthMDArray.size());
+ assert(nJ >= 0 && o3tl::make_unsigned(nJ) < aLengthMDArray.size());
+ return aLengthMDArray[nI][nJ];
}
// here might go overloads of md() taking other units ...