diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-21 22:53:38 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-11-21 22:53:38 +0100 |
commit | 356c4d50b6b06bbfcc4332868ff77407b338b6eb (patch) | |
tree | 403c7b1e3e1fa294c7458d3f45ed1cd9ded7a145 /src | |
parent | 9c6b9ae8b4cced28f610fc5b37590bfc5814a7ce (diff) |
a
Diffstat (limited to 'src')
-rw-r--r-- | src/wall-atlas.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/wall-atlas.cpp b/src/wall-atlas.cpp index c2f05c4f..31b2ad2d 100644 --- a/src/wall-atlas.cpp +++ b/src/wall-atlas.cpp @@ -94,13 +94,15 @@ wall_atlas::wall_atlas(Info info, const ImageView2D& img, auto wall_atlas::get_Direction(Direction_ num) const -> Direction* { + constexpr DirArrayIndex default_DAI; fm_debug_assert(num < Direction_::COUNT); if (_dir_array.isEmpty()) [[unlikely]] return {}; - if (auto idx = _direction_to_Direction_array_index[(uint8_t)num]) - return const_cast<Direction*>(&_dir_array[idx.val]); - return {}; + else if (auto DAI = _direction_to_Direction_array_index[(uint8_t)num]; DAI != default_DAI) [[likely]] + return const_cast<Direction*>(&_dir_array[DAI.val]); + else + return {}; } auto wall_atlas::frames(const Group& group) const -> ArrayView<const Frame> |