mirror of
https://github.com/matrix-construct/construct
synced 2024-09-26 02:18:53 +02:00
modules/client/rooms/members: Hoist event::fetch instance from loop.
This commit is contained in:
parent
317408fb75
commit
dae475664a
1 changed files with 3 additions and 7 deletions
|
@ -161,7 +161,8 @@ get__members(client &client,
|
|||
});
|
||||
|
||||
// stream to client
|
||||
members.for_each(membership, [&membership, &membership_match, &at_idx, &chunk]
|
||||
m::event::fetch event;
|
||||
members.for_each(membership, [&membership, &membership_match, &at_idx, &chunk, &event]
|
||||
(const m::user::id &member, const m::event::idx &event_idx)
|
||||
{
|
||||
if(event_idx > at_idx)
|
||||
|
@ -170,12 +171,7 @@ get__members(client &client,
|
|||
if(!membership && !membership_match(member, event_idx))
|
||||
return true;
|
||||
|
||||
const m::event::fetch event
|
||||
{
|
||||
event_idx, std::nothrow
|
||||
};
|
||||
|
||||
if(!event.valid)
|
||||
if(!seek(event, event_idx, std::nothrow))
|
||||
return true;
|
||||
|
||||
chunk.append(event);
|
||||
|
|
Loading…
Reference in a new issue