1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-04-16 08:42:23 +00:00

Less complex "index" and "at"

This commit is contained in:
trav5 2024-04-27 15:22:19 +02:00
parent b9358521cc
commit 897e43ae1e

View File

@ -101,14 +101,14 @@ namespace
const ESM::Dialogue* at(size_t index) const const ESM::Dialogue* at(size_t index) const
{ {
if (index >= getSize()) auto result = begin();
result += index;
if (result == end())
{ {
return nullptr; return nullptr;
} }
auto result = begin();
result += index;
return &(*result); return &(*result);
} }