0
0
Fork 0
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:
Jason Volk 2019-07-07 03:58:35 -07:00
parent cf853cf9ad
commit 7f102e7f8c

View file

@ -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)