0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 16:04:15 +01:00

ircd:Ⓜ️ Use room::events for exists(room_id) impl.

This commit is contained in:
Jason Volk 2019-09-16 13:43:46 -07:00
parent 839ca6f000
commit b0c386d54a

View file

@ -1241,20 +1241,15 @@ ircd::m::internal(const id::room &room_id)
bool
ircd::m::exists(const id::room &room_id)
{
const auto it
const m::room::events it
{
dbs::room_events.begin(room_id)
room_id, 0UL
};
if(!it)
return false;
const auto &[depth, event_idx]
{
dbs::room_events_key(it->first)
};
if(likely(depth < 2UL))
if(likely(it.depth() < 2UL))
return true;
if(my_host(room_id.host()) && creator(room_id, m::me))