Skip to content

Commit

Permalink
fix: allow using boolean to set the switch option
Browse files Browse the repository at this point in the history
  • Loading branch information
lafirest committed Nov 21, 2023
1 parent 183ea7a commit 36827df
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/erlfdb_nif.erl
Original file line number Diff line number Diff line change
Expand Up @@ -479,13 +479,15 @@ init() ->
end,

lists:foreach(
fun(Option) ->
case Option of
Name when is_atom(Name) ->
ok = network_set_option(Name, <<>>);
{Name, Value} when is_atom(Name) ->
ok = network_set_option(Name, Value)
end
fun
(Name) when is_atom(Name) ->
ok = network_set_option(Name, <<>>);
({Name, true}) when is_atom(Name) ->
ok = network_set_option(Name, <<>>);
({_Name, false}) ->
ok;
({Name, Value}) when is_atom(Name) ->
ok = network_set_option(Name, Value)
end,
Opts
),
Expand Down

0 comments on commit 36827df

Please sign in to comment.