From 9659d19718f1b179f4c726bcd064a80cf54a1c2b Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 26 Apr 2022 17:58:32 +0200 Subject: [PATCH] lib/upnp/Init: use if with initalizer --- src/lib/upnp/Init.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/upnp/Init.cxx b/src/lib/upnp/Init.cxx index 3a0a19bf3..559e44001 100644 --- a/src/lib/upnp/Init.cxx +++ b/src/lib/upnp/Init.cxx @@ -35,9 +35,7 @@ static unsigned upnp_ref; static void DoInit(const char* iface) { - - auto code = UpnpInit2(iface, 0); - if (code != UPNP_E_SUCCESS) + if (auto code = UpnpInit2(iface, 0); code != UPNP_E_SUCCESS) throw FormatRuntimeError("UpnpInit() failed: %s", UpnpGetErrorMessage(code));