From 4874a5d027ce94df3e045daf63934d652f976a0c Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 5 Feb 2025 05:20:50 +0100 Subject: move generated LUT into function scope --- src/hole-cut.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/hole-cut.cpp b/src/hole-cut.cpp index 7e580e9f..a7736762 100644 --- a/src/hole-cut.cpp +++ b/src/hole-cut.cpp @@ -124,8 +124,6 @@ constexpr element make_element(uint8_t s) fm_assert(false); } -constexpr auto elements = map(make_element, iota_array); - template constexpr auto get_value_from_coord(Vec2ʹ r0, Vec2ʹ r1, Vec2ʹ h0, Vec2ʹ h1, coords c) { @@ -154,8 +152,10 @@ constexpr bool check_empty(Vec2ʹ r0, Vec2ʹ r1, Vec2ʹ h0, Vec2ʹ h template constexpr Cr cut_rectangleʹ(Vec2ʹ r0, Vec2ʹ r1, Vec2ʹ h0, Vec2ʹ h1, uint8_t val) { + constexpr auto table = map(make_element, iota_array); + CORRADE_ASSUME(val < 16); - const auto elt = elements[val]; + const auto elt = table[val]; const auto sz = elt.size; Cr res = { .s = val, -- cgit v1.2.3