From 2abf13ae3676be45494cf354d6453bfce340c454 Mon Sep 17 00:00:00 2001 From: Michael M Date: Sun, 6 Aug 2017 23:05:51 -0700 Subject: [PATCH] NetPlayServer: remove goto statements --- Source/Core/Core/NetPlayServer.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index c961be5bc4..f7c4f401c8 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -959,17 +959,15 @@ void NetPlayServer::TryPortmapping(u16 port) void NetPlayServer::mapPortThread(const u16 port) { if (!m_upnp_inited) - if (!initUPnP()) - goto fail; + initUPnP(); - if (!UPnPMapPort(m_upnp_ourip, port)) - goto fail; + if (m_upnp_inited && UPnPMapPort(m_upnp_ourip, port)) + { + NOTICE_LOG(NETPLAY, "Successfully mapped port %d to %s.", port, m_upnp_ourip.c_str()); + return; + } - NOTICE_LOG(NETPLAY, "Successfully mapped port %d to %s.", port, m_upnp_ourip.c_str()); - return; -fail: WARN_LOG(NETPLAY, "Failed to map port %d to %s.", port, m_upnp_ourip.c_str()); - return; } // UPnP thread: try to unmap a port