mirror of
https://github.com/OpenMW/openmw.git
synced 2025-05-08 15:41:25 +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
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue