Skip to content
Permalink
Browse files
let it crash
  • Loading branch information
bartekgorny committed Apr 16, 2019
1 parent 29e3649 commit b02ce893afff3733f52114f503a150ac8204b4e0
Showing 2 changed files with 2 additions and 6 deletions.
@@ -44,9 +44,7 @@ clear() ->
limit(Label, #{} = Pattern, Limit) when is_atom(Label) ->
store_pattern(Label, Pattern, Limit);
limit(Label, Pattern, Limit) when is_atom(Label), is_function(Pattern) ->
store_pattern(Label, Pattern, Limit);
limit(_, _, _) ->
{error, "Bad argument - the spec is limit(atom(), map(), limit())"}.
store_pattern(Label, Pattern, Limit).

list() ->
ensure_table_exists(),
@@ -96,9 +96,7 @@ limit(Name, Arity, Limit) when is_atom(Name), is_integer(Arity) ->
[{Key, Fields, Mod, _}] ->
ets:insert(records_table_name(), {Key, Fields, Mod, Limit}),
ok
end;
limit(_, _, _) ->
{error, "Bad argument - the spec is limit(atom(), integer(), limit())"}.
end.

%% @private if a tuple is a known record, formats is as "#recname{field=value}", otherwise returns
%% just a printout of a tuple.

0 comments on commit b02ce89

Please sign in to comment.