From 3211dad3539511ed2988d733721fc0d62431fd40 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 24 Nov 2023 14:00:31 +0100 Subject: a --- src/wall-atlas.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/wall-atlas.cpp b/src/wall-atlas.cpp index a4bf9aa9..c540b57e 100644 --- a/src/wall-atlas.cpp +++ b/src/wall-atlas.cpp @@ -98,14 +98,11 @@ wall_atlas::wall_atlas(wall_atlas_def def, String path, 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.empty()) [[unlikely]] - return {}; - else if (auto DAI = _direction_map[(uint8_t)num]; DAI != default_DAI) [[likely]] + if (auto DAI = _direction_map[(uint8_t)num]) return const_cast(&_dir_array[DAI.val]); - else + else [[unlikely]] return {}; } -- cgit v1.2.3