From f85629afa603669c065ea639126da84b55d143f9 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 17 Jan 2024 18:27:18 +0100 Subject: [PATCH] lib/avahi/Client: is if with initializer --- src/lib/avahi/Client.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/avahi/Client.cxx b/src/lib/avahi/Client.cxx index 34529ee54..888d40df7 100644 --- a/src/lib/avahi/Client.cxx +++ b/src/lib/avahi/Client.cxx @@ -43,8 +43,6 @@ Client::Close() noexcept void Client::ClientCallback(AvahiClient *c, AvahiClientState state) noexcept { - int error; - switch (state) { case AVAHI_CLIENT_S_RUNNING: for (auto *l : listeners) @@ -53,8 +51,8 @@ Client::ClientCallback(AvahiClient *c, AvahiClientState state) noexcept break; case AVAHI_CLIENT_FAILURE: - error = avahi_client_errno(c); - if (error == AVAHI_ERR_DISCONNECTED) { + if (int error = avahi_client_errno(c); + error == AVAHI_ERR_DISCONNECTED) { Close(); reconnect_timer.Schedule(std::chrono::seconds(10));