mirror of
https://github.com/matrix-construct/construct
synced 2025-01-14 16:46:50 +01:00
modules/console: Sort any vector of results for eval.
This commit is contained in:
parent
b3a063bdac
commit
c1b98f43b3
1 changed files with 16 additions and 1 deletions
|
@ -4219,10 +4219,18 @@ console_cmd__fed__state(opt &out, const string_view &line)
|
||||||
vmopts
|
vmopts
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::vector<m::event> events;
|
||||||
|
events.reserve(size(pdus) + size(auth_chain));
|
||||||
|
|
||||||
for(const json::object &event : auth_chain)
|
for(const json::object &event : auth_chain)
|
||||||
eval(event);
|
events.emplace_back(event);
|
||||||
|
|
||||||
for(const json::object &event : pdus)
|
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);
|
eval(event);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -4366,7 +4374,14 @@ console_cmd__fed__backfill(opt &out, const string_view &line)
|
||||||
vmopts
|
vmopts
|
||||||
};
|
};
|
||||||
|
|
||||||
|
std::vector<m::event> events;
|
||||||
|
events.reserve(lex_cast<size_t>(count));
|
||||||
for(const json::object &event : pdus)
|
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);
|
eval(event);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue