From bce144a232d37547763d180bc43422f1963d4255 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 25 May 2021 22:14:27 +0200 Subject: [PATCH] zeroconf/AvahiPoll: move code to Schedule() --- src/zeroconf/AvahiPoll.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/zeroconf/AvahiPoll.cxx b/src/zeroconf/AvahiPoll.cxx index 41c3e4e54..1a81d3580 100644 --- a/src/zeroconf/AvahiPoll.cxx +++ b/src/zeroconf/AvahiPoll.cxx @@ -90,12 +90,12 @@ public: :event(_loop, BIND_THIS_METHOD(OnTimeout)), callback(_callback), userdata(_userdata) { if (tv != nullptr) - event.Schedule(ToSteadyClockDuration(*tv)); + Schedule(*tv); } static void TimeoutUpdate(AvahiTimeout *t, const struct timeval *tv) { if (tv != nullptr) - t->event.Schedule(ToSteadyClockDuration(*tv)); + t->Schedule(*tv); else t->event.Cancel(); } @@ -105,6 +105,10 @@ public: } private: + void Schedule(const struct timeval &tv) noexcept { + event.Schedule(ToSteadyClockDuration(tv)); + } + void OnTimeout() noexcept { callback(this, userdata); }