refactor: split list comprehension over fn calls
This commit is contained in:
parent
c23c534525
commit
ca973db2fc
|
@ -180,9 +180,18 @@ ensure_timer(URL, State = #state{refresh_timers = RefreshTimers0}, Timeout) ->
|
||||||
State#state{refresh_timers = RefreshTimers}.
|
State#state{refresh_timers = RefreshTimers}.
|
||||||
|
|
||||||
collect_urls(Listeners) ->
|
collect_urls(Listeners) ->
|
||||||
lists:usort([URL
|
CRLOpts0 = [CRLOpts || #{proto := ssl, opts := Opts} <- Listeners,
|
||||||
|| #{proto := ssl, opts := Opts} <- Listeners,
|
{crl_options, CRLOpts} <- Opts],
|
||||||
{crl_options, CRLOpts} <- Opts,
|
CRLOpts1 =
|
||||||
proplists:get_bool(crl_cache_enabled, CRLOpts),
|
lists:filter(
|
||||||
{crl_cache_urls, URLs} <- CRLOpts,
|
fun(CRLOpts) ->
|
||||||
URL <- URLs]).
|
proplists:get_bool(crl_cache_enabled, CRLOpts)
|
||||||
|
end,
|
||||||
|
CRLOpts0),
|
||||||
|
CRLURLs =
|
||||||
|
lists:flatmap(
|
||||||
|
fun(CRLOpts) ->
|
||||||
|
proplists:get_value(crl_cache_urls, CRLOpts, [])
|
||||||
|
end,
|
||||||
|
CRLOpts1),
|
||||||
|
lists:usort(CRLURLs).
|
||||||
|
|
Loading…
Reference in New Issue