mirror of
https://github.com/matrix-construct/construct
synced 2024-12-25 15:04:10 +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:
parent
8c33f21f95
commit
27a015b9dc
2 changed files with 4 additions and 14 deletions
|
@ -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<int64_t>(room_top)
|
||||
};
|
||||
|
||||
const m::event::id &room_head
|
||||
{
|
||||
std::get<m::event::id::buf>(room_top)
|
||||
};
|
||||
|
||||
json::stack::member
|
||||
{
|
||||
top, "start", event_id
|
||||
|
|
|
@ -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};
|
||||
|
|
Loading…
Reference in a new issue