Skip to content

Commit

Permalink
addressed dialyzer warnings
Browse files Browse the repository at this point in the history
Change-Id: I92a5791b1123e73e256a93efd711f61d7d6f7c92
Reviewed-on: http://review.couchbase.org/12174
Tested-by: Aliaksey Kandratsenka <alkondratenko@gmail.com>
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
  • Loading branch information
Aliaksey Kandratsenka authored and alk committed Jan 9, 2012
1 parent 2954ee1 commit d1cda0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/mc_couch_kv.erl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
-export([get/2, grok_doc/1, set/6, delete/2, mk_doc/5, mk_doc/6]).

%% ok, Flags, Expiration, Cas, Data
-spec get(_, binary()) -> {ok, integer(), integer(), integer(), binary()} | not_found.
-spec get(_, binary()) -> {ok, integer(), integer(), binary()} | not_found.
get(Db, Key) ->
case couch_db:open_doc_int(Db, Key, [json_bin_body]) of
{ok, Doc} -> grok_doc(Doc);
Expand Down Expand Up @@ -35,7 +35,7 @@ fast_parse_leading_key_number(Item, StrippedJson, Default) ->


%% ok, Flags, Expiration, Cas, Data
-spec grok_doc(#doc{}) -> {ok, integer(), integer(), integer(), binary()}.
-spec grok_doc(#doc{}) -> {ok, integer(), integer(), term()}.
grok_doc(Doc) ->
#doc{json= <<${, StrippedJsonBinary/binary>>, binary=Binary} = Doc,
{Flags, StrippedJsonBinary2} = fast_parse_leading_key_number(
Expand Down Expand Up @@ -112,7 +112,7 @@ set(Db, Key, Flags, Expiration, Value, JsonMode) ->
ok = couch_db:update_doc(Db, Doc, [clobber]),
0.

-spec delete(_, binary()) -> ok|not_found.
-spec delete(_, binary()) -> ok.
delete(Db, Key) ->
Doc = #doc{id = Key, deleted = true},
ok = couch_db:update_doc(Db, Doc, [clobber]),
Expand Down
5 changes: 1 addition & 4 deletions src/mc_daemon.erl
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ handle_set_call(Db, Key, Flags, Expiration, Value, JsonMode) ->
#mc_response{cas=NewCas}.

handle_delete_call(Db, Key) ->
case mc_couch_kv:delete(Db, Key) of
ok -> #mc_response{};
not_found -> #mc_response{status=1, body="Not found"}
end.
ok = mc_couch_kv:delete(Db, Key).

delete_db(State, Key) ->
lists:map(fun({N, _VBucketState} = VBucketAndState) ->
Expand Down

0 comments on commit d1cda0a

Please sign in to comment.