@@ -55,15 +55,15 @@ constexpr rotation arrows_to_dir_from_mask(unsigned mask)
5555 fm_assert (false );
5656}
5757
58- constexpr auto arrows_to_dir_array = map(arrows_to_dir_from_mask, iota_array<uint8_t , 16 >);
59-
6058constexpr auto arrows_to_dir (bool left, bool right, bool up, bool down)
6159{
60+ constexpr auto table = map (arrows_to_dir_from_mask, iota_array<uint8_t , 16 >);
6261 constexpr uint8_t L = 1 << 3 , R = 1 << 2 , U = 1 << 1 , D = 1 << 0 ;
63- const uint8_t bits = left*L | right*R | up*U | down*D;
6462 constexpr uint8_t mask = L|R|U|D;
63+
64+ const uint8_t bits = left*L | right*R | up*U | down*D;
6565 CORRADE_ASSUME ((bits & mask) == bits);
66- return arrows_to_dir_array .data ()[bits];
66+ return table .data ()[bits];
6767}
6868
6969#if 0
@@ -301,18 +301,18 @@ constexpr rotation dir_from_step_mask(uint8_t val)
301301 }
302302}
303303
304- constexpr auto dir_from_step_array = map(dir_from_step_mask, iota_array<uint8_t , 1 << 4 >);
305-
306304constexpr rotation dir_from_step (step_s step)
307305{
306+ constexpr auto table = map (dir_from_step_mask, iota_array<uint8_t , 1 << 4 >);
307+
308308 if (step.direction .isZero ()) [[unlikely]]
309309 return rotation_COUNT;
310310
311311 auto x = uint8_t (step.direction .x () + 1 );
312312 auto y = uint8_t (step.direction .y () + 1 );
313313 // fm_debug_assert((x & 3) == x && (y & 3) == y);
314314 auto val = uint8_t (x << 2 | y);
315- return dir_from_step_array .data ()[val];
315+ return table .data ()[val];
316316}
317317
318318constexpr step_s next_step (point from, point to)
0 commit comments