0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-29 00:03:45 +02:00

ircd:Ⓜ️:room::events::sounding: Improve depth-seek semantics of base iterations.

This commit is contained in:
Jason Volk 2020-11-12 19:07:44 -08:00
parent 4521054078
commit 04c398cc0c

View file

@ -548,9 +548,16 @@ bool
ircd::m::room::events::sounding::rfor_each(const closure &closure)
const
{
const int64_t depth
{
room.event_id?
m::get(std::nothrow, m::index(std::nothrow, room.event_id), "depth", -1L):
-1L
};
room::events it
{
room
room, uint64_t(depth)
};
if(!it)
@ -586,12 +593,19 @@ bool
ircd::m::room::events::sounding::for_each(const closure &closure)
const
{
room::events it
const int64_t depth
{
room, int64_t(0L)
room.event_id?
m::get(std::nothrow, m::index(std::nothrow, room.event_id), "depth", 0L):
0L
};
for(sounding::range range{0L, 0L}; it; ++it)
room::events it
{
room, uint64_t(depth)
};
for(sounding::range range{depth, 0L}; it; ++it)
{
range.second = it.depth();
if(range.first == range.second)