Skip to content

Commit

Permalink
Fix riak_kv_eleveldb_backend dialyzer errors
Browse files Browse the repository at this point in the history
Pair-programmed with @reiddraper

* db_ref is an opaque type, we don't know it's a reference
* dialyzer claims the last clause of fold_keys_fun is completely
  subsumed by the previous clauses. If it's not, we'll throw an
  exception either way with a bad match.
  • Loading branch information
Vagabond committed Apr 11, 2014
1 parent 5bd8486 commit 2eade19
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/riak_kv_eleveldb_backend.erl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
iterator_refresh]).
-define(FIXED_INDEXES_KEY, fixed_indexes).

-record(state, {ref :: reference(),
-record(state, {ref :: eleveldb:db_ref(),
data_root :: string(),
open_opts = [],
config :: config(),
Expand Down Expand Up @@ -794,9 +794,7 @@ fold_keys_fun(FoldKeysFun, {index, incorrect_format, ForUpgrade}) when is_boolea
fold_keys_fun(FoldKeysFun, {index, Bucket, V1Q}) ->
%% Handle legacy queries
Q = riak_index:upgrade_query(V1Q),
fold_keys_fun(FoldKeysFun, {index, Bucket, Q});
fold_keys_fun(_FoldKeysFun, Other) ->
throw({unknown_limiter, Other}).
fold_keys_fun(FoldKeysFun, {index, Bucket, Q}).

%% @private
%% To stop a fold in progress when pagination limit is reached.
Expand Down

0 comments on commit 2eade19

Please sign in to comment.