diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2009-11-21 13:43:43 +0000 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2009-11-21 13:43:43 +0000 |
commit | aef9dbd3a6cbb85085023d3c8565740e09fd6a77 (patch) | |
tree | 7ee342a14f36f7a21b2249b832c9700f082d55b6 /src/couchdb/couch_doc.erl | |
parent | 9c97bb531ed9b5d6fc18fcef87a6742514e984d5 (diff) |
code improvements from tidier. Patch by Kostis Sagonas. COUCHDB-570
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@882903 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_doc.erl')
-rw-r--r-- | src/couchdb/couch_doc.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/couchdb/couch_doc.erl b/src/couchdb/couch_doc.erl index eb07a9e6..d0c2918a 100644 --- a/src/couchdb/couch_doc.erl +++ b/src/couchdb/couch_doc.erl @@ -40,7 +40,7 @@ to_json_revisions(Options, Start, RevIds) -> {<<"ids">>, [revid_to_str(R) ||R <- RevIds]}]}}] end. -revid_to_str(RevId) when size(RevId) == 16 -> +revid_to_str(RevId) when size(RevId) =:= 16 -> ?l2b(couch_util:to_hex(RevId)); revid_to_str(RevId) -> RevId. @@ -122,10 +122,10 @@ from_json_obj({Props}) -> from_json_obj(_Other) -> throw({bad_request, "Document must be a JSON object"}). -parse_revid(RevId) when size(RevId) == 32 -> +parse_revid(RevId) when size(RevId) =:= 32 -> RevInt = erlang:list_to_integer(?b2l(RevId), 16), <<RevInt:128>>; -parse_revid(RevId) when length(RevId) == 32 -> +parse_revid(RevId) when length(RevId) =:= 32 -> RevInt = erlang:list_to_integer(RevId, 16), <<RevInt:128>>; parse_revid(RevId) when is_binary(RevId) -> @@ -222,7 +222,7 @@ transfer_fields([{<<"_revisions">>, {Props}} | Rest], Doc) -> RevIds2 = [parse_revid(RevId) || RevId <- RevIds], transfer_fields(Rest, Doc#doc{revs={Start, RevIds2}}); -transfer_fields([{<<"_deleted">>, B} | Rest], Doc) when (B==true) or (B==false) -> +transfer_fields([{<<"_deleted">>, B} | Rest], Doc) when is_boolean(B) -> transfer_fields(Rest, Doc#doc{deleted=B}); % ignored fields |