0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-04 21:08:57 +01:00

ircd:Ⓜ️:room::auth: Parallelize index query.

This commit is contained in:
Jason Volk 2020-09-17 01:43:06 -07:00
parent 076384d697
commit 347cdba1c6

View file

@ -574,14 +574,19 @@ ircd::m::room::auth::static_idx(const event &event)
count,
};
return
size_t i(0);
m::event::id ids[5];
std::array<m::event::idx, 5> idxs {{0}};
for(; i < count && i < 5; ++i)
ids[i] = refs.auth_event(i);
assert(i <= idxs.size());
const auto found
{
count > 0? m::index(refs.auth_event(0)): 0UL,
count > 1? m::index(refs.auth_event(1)): 0UL,
count > 2? m::index(refs.auth_event(2)): 0UL,
count > 3? m::index(refs.auth_event(3)): 0UL,
count > 4? m::index(refs.auth_event(4)): 0UL,
m::index(idxs, vector_view<const m::event::id>(ids, i))
};
return idxs;
}
std::array<ircd::m::event::idx, 5>