Use lists:foldl/3

This commit is contained in:
Evgeniy Khramtsov 2018-06-27 13:36:58 +03:00
parent af8c6d2428
commit 9a11db91f9
1 changed files with 6 additions and 7 deletions

View File

@ -689,13 +689,12 @@ iq_disco_info(Host, Lang, Name, AddInfo) ->
infinity ->
AddInfo;
MaxSize ->
XData = lists:map(
fun(NS) ->
Fs = http_upload:encode(
[{'max-file-size', MaxSize}], NS, Lang),
#xdata{type = result, fields = Fs}
end, [?NS_HTTP_UPLOAD, ?NS_HTTP_UPLOAD_0]),
XData ++ AddInfo
lists:foldl(
fun(NS, Acc) ->
Fs = http_upload:encode(
[{'max-file-size', MaxSize}], NS, Lang),
[#xdata{type = result, fields = Fs}|Acc]
end, AddInfo, [?NS_HTTP_UPLOAD_0, ?NS_HTTP_UPLOAD])
end,
#disco_info{identities = [#identity{category = <<"store">>,
type = <<"file">>,