0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-29 10:12:39 +01:00

ircd:Ⓜ️:events: Improve robustness of loop conditions; range controls.

This commit is contained in:
Jason Volk 2020-08-25 13:00:31 -07:00
parent 64e5df1d86
commit 9c4aea4ca6

View file

@ -214,7 +214,7 @@ ircd::m::events::for_each(const range &range,
if(!closure(event_idx, event))
return false;
return --limit;
return --limit > 0L;
});
}
@ -235,7 +235,7 @@ ircd::m::events::for_each(const range &range,
auto start
{
ascending?
range.first:
std::min(range.first, vm::sequence::retired + 1):
std::min(range.first, vm::sequence::retired)
};
@ -284,7 +284,7 @@ ircd::m::events::for_each(const range &range,
if(!closure(event_idx))
return false;
return --limit;
return --limit > 0L;
}});
return true;