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

ircd:Ⓜ️:vm: Remove call operators; inline trivial getter.

This commit is contained in:
Jason Volk 2020-09-13 15:29:28 -07:00
parent bf8dd39144
commit fb1f36ce72
3 changed files with 9 additions and 38 deletions

View file

@ -98,11 +98,10 @@ struct ircd::m::vm::eval
void mfetch_keys() const; void mfetch_keys() const;
public: public:
operator const event::id::buf &() const; operator const event::id::buf &() const
{
fault operator()(const event &); return event_id;
size_t operator()(const vector_view<m::event> &); }
fault operator()(json::iov &event, const json::iov &content); //inject
eval(const vm::opts &); eval(const vm::opts &);
eval(const vm::copts &); eval(const vm::copts &);

View file

@ -275,7 +275,7 @@ try
}; };
size_t count {0}, ebytes[2] {0}, accept {0}, exists {0}; size_t count {0}, ebytes[2] {0}, accept {0}, exists {0};
vm::eval execute vm::eval eval
{ {
vmopts vmopts
}; };
@ -296,7 +296,7 @@ try
const auto code const auto code
{ {
execute(event) execute(eval, event)
}; };
count += 1; count += 1;

View file

@ -355,14 +355,14 @@ ircd::m::vm::eval::eval(json::iov &event,
const vm::copts &opts) const vm::copts &opts)
:eval{opts} :eval{opts}
{ {
operator()(event, content); inject(*this, event, content);
} }
ircd::m::vm::eval::eval(const event &event, ircd::m::vm::eval::eval(const event &event,
const vm::opts &opts) const vm::opts &opts)
:eval{opts} :eval{opts}
{ {
operator()(event); execute(*this, event);
} }
ircd::m::vm::eval::eval(const json::array &pdus, ircd::m::vm::eval::eval(const json::array &pdus,
@ -378,7 +378,7 @@ ircd::m::vm::eval::eval(const json::array &pdus,
if(likely(!opts.ordered)) if(likely(!opts.ordered))
std::sort(begin(events), end(events)); std::sort(begin(events), end(events));
operator()(events); execute(*this, events);
} }
ircd::m::vm::eval::eval(const vector_view<m::event> &events, ircd::m::vm::eval::eval(const vector_view<m::event> &events,
@ -399,34 +399,6 @@ noexcept
} }
} }
/// Inject a new event originating from this server.
///
ircd::m::vm::fault
ircd::m::vm::eval::operator()(json::iov &event,
const json::iov &contents)
{
return vm::inject(*this, event, contents);
}
size_t
ircd::m::vm::eval::operator()(const vector_view<m::event> &events)
{
return vm::execute(*this, events);
}
ircd::m::vm::fault
ircd::m::vm::eval::operator()(const event &event)
{
return vm::execute(*this, event);
}
ircd::m::vm::eval::operator
const event::id::buf &()
const
{
return event_id;
}
void void
ircd::m::vm::eval::mfetch_keys() ircd::m::vm::eval::mfetch_keys()
const const