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

modules/console: Use the loop eval overload rather than sorting here.

This commit is contained in:
Jason Volk 2019-06-07 03:21:26 -07:00
parent 92761f5d9f
commit d15df05966

View file

@ -11850,23 +11850,9 @@ console_cmd__fed__state(opt &out, const string_view &line)
vmopts.non_conform.set(m::event::conforms::MISSING_PREV_STATE);
m::vm::eval eval
{
vmopts
pdus, vmopts
};
std::vector<m::event> events;
events.reserve(size(pdus) + size(auth_chain));
for(const json::object &event : auth_chain)
events.emplace_back(event);
for(const json::object &event : pdus)
events.emplace_back(event);
std::sort(begin(events), end(events));
events.erase(std::unique(begin(events), end(events)), end(events));
for(const auto &event : events)
eval(event);
return true;
}
@ -12017,19 +12003,9 @@ console_cmd__fed__backfill(opt &out, const string_view &line)
vmopts.node_id = string(rembuf, remote);
m::vm::eval eval
{
vmopts
pdus, vmopts
};
std::vector<m::event> events;
events.reserve(lex_cast<size_t>(count));
for(const json::object &event : pdus)
events.emplace_back(event);
std::sort(begin(events), end(events));
events.erase(std::unique(begin(events), end(events)), end(events));
for(const auto &event : events)
eval(event);
return true;
}