From: Peter Powell Date: Sat, 20 Jan 2018 00:32:31 +0000 (+0000) Subject: Remove duplicated code in LocalUser::GetServerPort(). X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=be12938393585ba0994a1aeaafcb6fd879580506;p=user%2Fhenk%2Fcode%2Finspircd.git Remove duplicated code in LocalUser::GetServerPort(). --- diff --git a/src/users.cpp b/src/users.cpp index 41caa5c5a..5ddd98def 100644 --- a/src/users.cpp +++ b/src/users.cpp @@ -648,14 +648,7 @@ void LocalUser::OverruleNick() int LocalUser::GetServerPort() { - switch (this->server_sa.sa.sa_family) - { - case AF_INET6: - return htons(this->server_sa.in6.sin6_port); - case AF_INET: - return htons(this->server_sa.in4.sin_port); - } - return 0; + return this->server_sa.port(); } const std::string& User::GetIPString()