From 2a09c19703b242aaf693e5b52a70c1ad65332119 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 19 Dec 2020 11:58:34 +0100 Subject: Avoid "else" after "return" --- include/raul/Socket.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/raul/Socket.hpp') diff --git a/include/raul/Socket.hpp b/include/raul/Socket.hpp index 66b5a45..74a1595 100644 --- a/include/raul/Socket.hpp +++ b/include/raul/Socket.hpp @@ -159,7 +159,9 @@ Socket::set_addr(const std::string& uri) _addr = reinterpret_cast(uaddr); _addr_len = sizeof(struct sockaddr_un); return true; - } else if (_type == Type::TCP && uri.find("://") != std::string::npos) { + } + + if (_type == Type::TCP && uri.find("://") != std::string::npos) { const std::string authority = uri.substr(uri.find("://") + 3); const size_t port_sep = authority.find(':'); if (port_sep == std::string::npos) { @@ -184,6 +186,7 @@ Socket::set_addr(const std::string& uri) freeaddrinfo(ainfo); return true; } + return false; } -- cgit v1.2.1