event/MultiSocketMonitor: use std::exchange()
This commit is contained in:
parent
a84bf5a92e
commit
e3b347820a
@ -64,9 +64,7 @@ MultiSocketMonitor::ReplaceSocketList(pollfd *pfds, unsigned n) noexcept
|
|||||||
if (i == end)
|
if (i == end)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
auto events = i->events;
|
return std::exchange(i->events, 0);
|
||||||
i->events = 0;
|
|
||||||
return events;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
for (auto i = pfds; i != end; ++i)
|
for (auto i = pfds; i != end; ++i)
|
||||||
|
Loading…
Reference in New Issue
Block a user