From 17a583514367a52ddbca12dd5ab621262adaf50e Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 6 Sep 2022 17:41:09 +0200 Subject: [PATCH] Simplify recent commit (thanks to Simon Lipp)(#3894) --- src/misc.erl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/misc.erl b/src/misc.erl index 8662e5f19..232e0ea33 100644 --- a/src/misc.erl +++ b/src/misc.erl @@ -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)).