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:
@@ -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 ->
|
||||
|
||||
@@ -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().
|
||||
|
||||
Reference in New Issue
Block a user