Commit e3b34782 authored by Max Kellermann's avatar Max Kellermann

event/MultiSocketMonitor: use std::exchange()

parent a84bf5a9
......@@ -64,9 +64,7 @@ MultiSocketMonitor::ReplaceSocketList(pollfd *pfds, unsigned n) noexcept
if (i == end)
return 0;
auto events = i->events;
i->events = 0;
return events;
return std::exchange(i->events, 0);
});
for (auto i = pfds; i != end; ++i)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment