From 471c67946f7eebc6916eccd9fccdc0965e811e1c Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Wed, 10 Sep 2014 10:04:54 +0200 Subject: Get rid of dialyzer warning. Specify the match as a tuple rather than a record since dialyzer correctly reports that #plop fields cannot be atoms. The drawback is that the match needs updating when the definition of #plop{} changes, including merely reordering of fields. --- src/db.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/db.erl b/src/db.erl index aa6cc29..8f398cb 100644 --- a/src/db.erl +++ b/src/db.erl @@ -146,7 +146,7 @@ handle_call({get_by_index_sorted, {Start, End}}, _From, State) -> select_index(Start, End) -> F = fun() -> - MatchHead = #plop{index = '$1', mtl = '$2', _ = '_'}, + MatchHead = {plop, '$1', '_', '$2', '_'}, Guard = [{'>=', '$1', Start}, {'=<', '$1', End}], Result = ['$$'], mnesia:select(plop, [{MatchHead, Guard, Result}]) -- cgit v1.1