mirror of
https://github.com/matrix-construct/construct
synced 2024-09-27 11:18:51 +02: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
|
// putting them back when we're finished. This requires a const_cast which
|
||||||
// should be okay here.
|
// should be okay here.
|
||||||
auto &room(const_cast<m::room &>(this->room));
|
auto &room(const_cast<m::room &>(this->room));
|
||||||
const auto theirs{room.fopts};
|
const scope_restore theirs
|
||||||
room.fopts = &fopts;
|
|
||||||
const unwind reset{[&room, &theirs]
|
|
||||||
{
|
{
|
||||||
room.fopts = theirs;
|
room.fopts, &fopts
|
||||||
}};
|
};
|
||||||
|
|
||||||
return for_each(membership, event::closure_bool{[&closure]
|
return for_each(membership, event::closure_bool{[&closure]
|
||||||
(const event &event)
|
(const event &event)
|
||||||
|
|
Loading…
Reference in a new issue