From 7764719513b02149e8b101b298462a98de70fbbe Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 22 Dec 2019 12:00:12 +0100 Subject: [PATCH] event/MultiSocketMonitor: un-inline AddSocket() --- src/event/MultiSocketMonitor.cxx | 12 ++++++++++++ src/event/MultiSocketMonitor.hxx | 10 +--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/event/MultiSocketMonitor.cxx b/src/event/MultiSocketMonitor.cxx index f747fd0f9..98d57332c 100644 --- a/src/event/MultiSocketMonitor.cxx +++ b/src/event/MultiSocketMonitor.cxx @@ -42,6 +42,18 @@ MultiSocketMonitor::Reset() noexcept ready = refresh = false; } +bool +MultiSocketMonitor::AddSocket(SocketDescriptor fd, unsigned events) noexcept +{ + fds.emplace_front(*this, fd); + bool success = fds.front().Schedule(events); + if (!success) { + fds.pop_front(); + } + + return success; +} + void MultiSocketMonitor::ClearSocketList() noexcept { diff --git a/src/event/MultiSocketMonitor.hxx b/src/event/MultiSocketMonitor.hxx index c4bad8ac0..c1d363a29 100644 --- a/src/event/MultiSocketMonitor.hxx +++ b/src/event/MultiSocketMonitor.hxx @@ -145,15 +145,7 @@ public: * * May only be called from PrepareSockets(). */ - bool AddSocket(SocketDescriptor fd, unsigned events) noexcept { - fds.emplace_front(*this, fd); - bool success = fds.front().Schedule(events); - if (!success) { - fds.pop_front(); - } - - return success; - } + bool AddSocket(SocketDescriptor fd, unsigned events) noexcept; /** * Remove all sockets.