summaryrefslogtreecommitdiffhomepage
path: root/src/wall-atlas.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-11-24 14:00:31 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-11-24 14:00:31 +0100
commit3211dad3539511ed2988d733721fc0d62431fd40 (patch)
tree6fef840f3b071a8f85f8e70e06cdd3b83d2486af /src/wall-atlas.cpp
parent6122c00992a51bea45bdbae8cdd10d299445a690 (diff)
a
Diffstat (limited to 'src/wall-atlas.cpp')
-rw-r--r--src/wall-atlas.cpp7
1 files changed, 2 insertions, 5 deletions
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<Direction*>(&_dir_array[DAI.val]);
- else
+ else [[unlikely]]
return {};
}