diff --git a/modules/s_fetch.cc b/modules/s_fetch.cc index f7971d2f0..3fc93d702 100644 --- a/modules/s_fetch.cc +++ b/modules/s_fetch.cc @@ -462,19 +462,11 @@ ircd::m::fetch::auth_chain(const room &room, request.wait(seconds(auth_timeout)); //TODO: conf request.get(); - const json::array &array + const json::array &events { request }; - std::vector events(array.count()); - std::copy(begin(array), end(array), begin(events)); - std::sort(begin(events), end(events), [] - (const json::object &a, const json::object &b) - { - return a.at("depth") < b.at("depth"); - }); - log::debug { log, "Evaluating %zu auth events in chain for %s in %s from %s", @@ -488,11 +480,10 @@ ircd::m::fetch::auth_chain(const room &room, vmopts.infolog_accept = true; vmopts.fetch_prev_check = false; vmopts.fetch_state_check = false; - for(const auto &event : events) - m::vm::eval - { - m::event{event}, vmopts - }; + m::vm::eval + { + events, vmopts + }; } bool