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

ircd:Ⓜ️:room::auth: Simplify closure requirements.

This commit is contained in:
Jason Volk 2019-02-12 17:47:08 -08:00
parent 74fdda36e2
commit aaf80932fe
3 changed files with 6 additions and 5 deletions

View file

@ -15,8 +15,8 @@
/// ///
struct ircd::m::room::auth struct ircd::m::room::auth
{ {
using closure_bool = std::function<bool (const event::idx &, const event &)>; using closure_bool = std::function<bool (const event::idx &)>;
using closure = std::function<void (const event::idx &, const event &)>; using closure = std::function<void (const event::idx &)>;
m::room room; m::room room;

View file

@ -2059,9 +2059,9 @@ ircd::m::room::auth::for_each(const closure &c)
const const
{ {
for_each(closure_bool{[this, &c] for_each(closure_bool{[this, &c]
(const auto &a, const auto &b) (const auto &event_idx)
{ {
c(a, b); c(event_idx);
return true; return true;
}}); }});
} }

View file

@ -8210,8 +8210,9 @@ console_cmd__room__auth(opt &out, const string_view &line)
}; };
auth.for_each([&out] auth.for_each([&out]
(const m::event::idx &idx, const m::event &event) (const m::event::idx &idx)
{ {
const m::event::fetch event{idx};
out << idx out << idx
<< " " << pretty_oneline(event) << " " << pretty_oneline(event)
<< std::endl; << std::endl;