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

ircd:Ⓜ️:room::events::missing: Add count() to interface.

This commit is contained in:
Jason Volk 2019-08-30 21:37:40 -07:00
parent 56d80751ec
commit 3d5b2ca262
2 changed files with 17 additions and 0 deletions

View file

@ -109,6 +109,7 @@ struct ircd::m::room::events::missing
public:
bool for_each(const closure &) const;
size_t count() const;
missing() = default;
missing(const m::room &room)

View file

@ -174,6 +174,22 @@ ircd::m::room::events::count(const m::room &room,
// room::events::missing
//
size_t
IRCD_MODULE_EXPORT
ircd::m::room::events::missing::count()
const
{
size_t ret{0};
for_each([&ret]
(const auto &event_id, const auto &depth, const auto &event_idx)
{
++ret;
return true;
});
return ret;
}
bool
IRCD_MODULE_EXPORT
ircd::m::room::events::missing::for_each(const closure &closure)