Skip to content

Commit 9d831ef

Browse files
committed
Return last unclosed iteration upon currentIteration
1 parent ec449af commit 9d831ef

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/snapshots/ContainerImpls.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -352,14 +352,14 @@ RandomAccessIteratorContainer &RandomAccessIteratorContainer::operator=(
352352
auto RandomAccessIteratorContainer::currentIteration() const
353353
-> std::optional<value_type const *>
354354
{
355-
if (auto begin = m_cont.begin(); begin != m_cont.end())
355+
for (auto begin = m_cont.rbegin(); begin != m_cont.rend(); ++begin)
356356
{
357-
return std::make_optional<value_type const *>(&*begin);
358-
}
359-
else
360-
{
361-
return std::nullopt;
357+
if (!begin->second.closed())
358+
{
359+
return std::make_optional<value_type const *>(&*begin);
360+
}
362361
}
362+
return std::nullopt;
363363
}
364364

365365
auto RandomAccessIteratorContainer::begin() -> iterator

0 commit comments

Comments
 (0)