From b0c386d54a02637d28ee674652f1bd3415ce2c37 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 16 Sep 2019 13:43:46 -0700 Subject: [PATCH] ircd::m: Use room::events for exists(room_id) impl. --- ircd/m_room.cc | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/ircd/m_room.cc b/ircd/m_room.cc index c524fec4c..720972412 100644 --- a/ircd/m_room.cc +++ b/ircd/m_room.cc @@ -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))