summaryrefslogtreecommitdiff
path: root/src/event/MultiSocketMonitor.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-12-20 13:42:35 +0100
committerMax Kellermann <max@musicpd.org>2019-12-20 13:42:35 +0100
commite3b347820aef0bd495eb37df3e1d6caa4f5c10de (patch)
treea9d7d547cad735527aacdeb13b9bdad5e6c8aeac /src/event/MultiSocketMonitor.cxx
parenta84bf5a92ede3fe38e9b3fc2882d7080d59c13b1 (diff)
event/MultiSocketMonitor: use std::exchange()
Diffstat (limited to 'src/event/MultiSocketMonitor.cxx')
-rw-r--r--src/event/MultiSocketMonitor.cxx4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/event/MultiSocketMonitor.cxx b/src/event/MultiSocketMonitor.cxx
index b3cd8675c..f747fd0f9 100644
--- a/src/event/MultiSocketMonitor.cxx
+++ b/src/event/MultiSocketMonitor.cxx
@@ -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)