refactor: change style of case clause

This commit is contained in:
Thales Macedo Garitezi 2024-07-24 10:13:48 -03:00
parent 216a6abed9
commit 2d507146ab
1 changed files with 4 additions and 6 deletions

View File

@ -498,13 +498,11 @@ with_link(Name, FoundFn, NotFoundFn) ->
case emqx_cluster_link_config:link_raw(Name) of case emqx_cluster_link_config:link_raw(Name) of
undefined -> undefined ->
NotFoundFn(); NotFoundFn();
Link0 = #{} -> Link0 = #{} when is_function(FoundFn, 1) ->
Link = fill_defaults_single(Link0), Link = fill_defaults_single(Link0),
{arity, Arity} = erlang:fun_info(FoundFn, arity), FoundFn(Link);
case Arity of _Link = #{} when is_function(FoundFn, 0) ->
1 -> FoundFn(Link); FoundFn()
0 -> FoundFn()
end
end. end.
fill_defaults_single(Link0) -> fill_defaults_single(Link0) ->