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:
parent
b9358521cc
commit
897e43ae1e
@ -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…
x
Reference in New Issue
Block a user