Skip to content

Commit

Permalink
Simplify recent commit (thanks to Simon Lipp)(#3894)
Browse files Browse the repository at this point in the history
  • Loading branch information
badlop committed Sep 7, 2022
1 parent f542a82 commit 17a5835
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/misc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -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)).

Expand Down

0 comments on commit 17a5835

Please sign in to comment.