event/MultiSocketMonitor: use std::exchange()

This commit is contained in:
Max Kellermann 2019-12-20 13:42:35 +01:00
parent a84bf5a92e
commit e3b347820a
1 changed files with 1 additions and 3 deletions

View File

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