mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 17:06:40 +00:00
Less complex "index" and "at"
This commit is contained in:
parent
b9358521cc
commit
897e43ae1e
1 changed files with 4 additions and 4 deletions
|
@ -101,14 +101,14 @@ namespace
|
|||
|
||||
const ESM::Dialogue* at(size_t index) const
|
||||
{
|
||||
if (index >= getSize())
|
||||
auto result = begin();
|
||||
result += index;
|
||||
|
||||
if (result == end())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto result = begin();
|
||||
result += index;
|
||||
|
||||
return &(*result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue