Skip to content
Permalink
Browse files
Allow an ets_lru to be completely disabled
  • Loading branch information
wohali committed Jun 2, 2017
1 parent c05488c commit 80cc7e1a21e35a643c7b9f26b9939ac6af0cc5ce
Showing 1 changed file with 3 additions and 3 deletions.
@@ -326,11 +326,11 @@ next_timeout(St) ->

set_options(St, []) ->
St;
set_options(St, [{max_objects, N} | Rest]) when is_integer(N), N > 0 ->
set_options(St, [{max_objects, N} | Rest]) when is_integer(N), N >= 0 ->
set_options(St#st{max_objs=N}, Rest);
set_options(St, [{max_size, N} | Rest]) when is_integer(N), N > 0 ->
set_options(St, [{max_size, N} | Rest]) when is_integer(N), N >= 0 ->
set_options(St#st{max_size=N}, Rest);
set_options(St, [{max_lifetime, N} | Rest]) when is_integer(N), N > 0 ->
set_options(St, [{max_lifetime, N} | Rest]) when is_integer(N), N >= 0 ->
set_options(St#st{max_lifetime=N}, Rest);
set_options(_, [Opt | _]) ->
throw({invalid_option, Opt}).

0 comments on commit 80cc7e1

Please sign in to comment.