25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Simplify recent commit (thanks to Simon Lipp)(#3894)

This commit is contained in:
Badlop 2022-09-06 17:41:09 +02:00
parent f542a82309
commit 17a5835143

View File

@ -220,15 +220,13 @@ encode_base64(Data) ->
-spec ip_to_list(inet:ip_address() | undefined |
{inet:ip_address(), inet:port_number()}) -> binary().
ip_to_list({local, _}) ->
<<"unix">>;
ip_to_list(local) ->
<<"unix">>;
ip_to_list({IP, _Port}) ->
ip_to_list(IP);
%% This function clause could use inet_parse too:
ip_to_list(undefined) ->
<<"unknown">>;
ip_to_list(local) ->
<<"unix">>;
ip_to_list(IP) ->
list_to_binary(inet_parse:ntoa(IP)).