diff options
| author | Stanislaw Halik <sthalik@misaki.pl> | 2025-02-05 05:20:50 +0100 |
|---|---|---|
| committer | Stanislaw Halik <sthalik@misaki.pl> | 2025-02-05 06:22:43 +0100 |
| commit | 4874a5d027ce94df3e045daf63934d652f976a0c (patch) | |
| tree | 56398fda23ba818689ed6cc9b5669fa9d2137624 /src/hole-cut.cpp | |
| parent | 616deca57a5084b52085e1cabea7eac130d812bd (diff) | |
move generated LUT into function scope
Diffstat (limited to 'src/hole-cut.cpp')
| -rw-r--r-- | src/hole-cut.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<uint8_t, 16>); - template<typename T> constexpr auto get_value_from_coord(Vec2ʹ<T> r0, Vec2ʹ<T> r1, Vec2ʹ<T> h0, Vec2ʹ<T> h1, coords c) { @@ -154,8 +152,10 @@ constexpr bool check_empty(Vec2ʹ<T> r0, Vec2ʹ<T> r1, Vec2ʹ<T> h0, Vec2ʹ<T> h template<typename T> constexpr Cr<T> cut_rectangleʹ(Vec2ʹ<T> r0, Vec2ʹ<T> r1, Vec2ʹ<T> h0, Vec2ʹ<T> h1, uint8_t val) { + constexpr auto table = map(make_element, iota_array<uint8_t, 16>); + CORRADE_ASSUME(val < 16); - const auto elt = elements[val]; + const auto elt = table[val]; const auto sz = elt.size; Cr<T> res = { .s = val, |
