diff --git a/modules/client/events.cc b/modules/client/events.cc index d4de178b1..6df55b478 100644 --- a/modules/client/events.cc +++ b/modules/client/events.cc @@ -153,21 +153,11 @@ get__events(client &client, out }; - const auto &room_top + const auto &[room_head, room_depth, room_head_idx] { m::top(room_id) }; - const auto &room_depth - { - std::get(room_top) - }; - - const m::event::id &room_head - { - std::get(room_top) - }; - json::stack::member { top, "start", event_id diff --git a/modules/client/sync/rooms.cc b/modules/client/sync/rooms.cc index f4b4b588f..9d7354e28 100644 --- a/modules/client/sync/rooms.cc +++ b/modules/client/sync/rooms.cc @@ -228,19 +228,19 @@ ircd::m::sync::_rooms_polylog_room(data &data, *data.out, room.room_id }; - const auto top + const auto &[top_event_id, top_depth, top_event_idx] { m::top(std::nothrow, room) }; const scope_restore their_head { - data.room_head, std::get<2>(top) + data.room_head, top_event_idx }; const scope_restore their_depth { - data.room_depth, std::get<1>(top) + data.room_depth, top_depth }; bool ret{false};