0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-25 23:14:13 +01:00

ircd:Ⓜ️ Minor cleanup.

This commit is contained in:
Jason Volk 2019-01-10 13:16:41 -08:00
parent 2d860b25a8
commit 26ee1c9b5c
2 changed files with 7 additions and 1 deletions

View file

@ -14,6 +14,8 @@
namespace ircd::m
{
// [GET] Count the events in the room between two indexes.
// Note the range here is unusual: The start index is exclusive, the ending
// index is inclusive. The start index must be valid and in the room.
size_t count_since(const room &, const m::event::idx &, const m::event::idx &);
size_t count_since(const room &, const m::event::id &, const m::event::id &);
size_t count_since(const m::event::idx &, const m::event::idx &);

View file

@ -21,8 +21,12 @@ count_since(const m::room &room,
const m::event::idx &a,
const m::event::idx &b)
{
m::room::messages it
{
room
};
assert(a <= b);
m::room::messages it{room};
it.seek_idx(a);
if(!it && !exists(room))