mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 18:22:50 +01:00
ircd:Ⓜ️:room: Use scope_restore here.
This commit is contained in:
parent
cf853cf9ad
commit
7f102e7f8c
1 changed files with 3 additions and 5 deletions
|
@ -3219,12 +3219,10 @@ const
|
|||
// putting them back when we're finished. This requires a const_cast which
|
||||
// should be okay here.
|
||||
auto &room(const_cast<m::room &>(this->room));
|
||||
const auto theirs{room.fopts};
|
||||
room.fopts = &fopts;
|
||||
const unwind reset{[&room, &theirs]
|
||||
const scope_restore theirs
|
||||
{
|
||||
room.fopts = theirs;
|
||||
}};
|
||||
room.fopts, &fopts
|
||||
};
|
||||
|
||||
return for_each(membership, event::closure_bool{[&closure]
|
||||
(const event &event)
|
||||
|
|
Loading…
Reference in a new issue