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

modules/client/sync: Minor cleanup; use structured binding for m::top().

modules/client/events: Minor cleanup; use structured binding for m::top().
This commit is contained in:
Jason Volk 2020-04-03 15:09:32 -07:00
parent 8c33f21f95
commit 27a015b9dc
2 changed files with 4 additions and 14 deletions

View file

@ -153,21 +153,11 @@ get__events(client &client,
out out
}; };
const auto &room_top const auto &[room_head, room_depth, room_head_idx]
{ {
m::top(room_id) m::top(room_id)
}; };
const auto &room_depth
{
std::get<int64_t>(room_top)
};
const m::event::id &room_head
{
std::get<m::event::id::buf>(room_top)
};
json::stack::member json::stack::member
{ {
top, "start", event_id top, "start", event_id

View file

@ -228,19 +228,19 @@ ircd::m::sync::_rooms_polylog_room(data &data,
*data.out, room.room_id *data.out, room.room_id
}; };
const auto top const auto &[top_event_id, top_depth, top_event_idx]
{ {
m::top(std::nothrow, room) m::top(std::nothrow, room)
}; };
const scope_restore their_head const scope_restore their_head
{ {
data.room_head, std::get<2>(top) data.room_head, top_event_idx
}; };
const scope_restore their_depth const scope_restore their_depth
{ {
data.room_depth, std::get<1>(top) data.room_depth, top_depth
}; };
bool ret{false}; bool ret{false};