Amend recent commits: lists:append is preferable for 1-level deep lists

See
https://www.erlang.org/doc/system/listhandling.html#deep-and-flat-lists
This commit is contained in:
Badlop
2026-01-08 12:48:15 +01:00
parent be56e1305b
commit 40d86edbc2
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -934,7 +934,7 @@ find_handler_port_path(Tls, Handler) ->
(_) ->
[]
end, ets:tab2list(ejabberd_listener)),
lists:flatten(Paths).
lists:append(Paths).
find_handler_port_path_option(ThisTls, Port, Handler, Handlers) ->
lists:filtermap(fun({Path, H}) when H == Handler ->
+1 -1
View File
@@ -2017,7 +2017,7 @@ nice_this(This) when is_atom(This) ->
nice_this(This) when is_binary(This) ->
nice_this(binary_to_list(This));
nice_this(This) when is_list(This) ->
list_to_binary(lists:flatten([string:titlecase(Word)
list_to_binary(lists:append([string:titlecase(Word)
|| Word <- string:replace(This, "_", " ", all)])).
-spec long_this(These :: [This :: atom()]) -> Long :: binary().