summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2014-09-10 10:04:54 +0200
committerLinus Nordberg <linus@nordberg.se>2014-09-10 10:04:54 +0200
commit471c67946f7eebc6916eccd9fccdc0965e811e1c (patch)
treef97c00513a86c89b2946020e4cc5165696bbed59
parent7a9ce6cd6e57d371ce4a512f74f5ad6d70c556a1 (diff)
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.
-rw-r--r--src/db.erl2
1 files changed, 1 insertions, 1 deletions
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}])