iilyak commented on a change in pull request #3568:
URL: https://github.com/apache/couchdb/pull/3568#discussion_r635204542
##########
File path: src/couch/src/couch_doc.erl
##########
@@ -116,14 +131,23 @@ to_json_attachments(Atts, OutputData, Follows, ShowEnc) ->
to_json_obj(Doc, Options) ->
doc_to_json_obj(Doc, Options).
-doc_to_json_obj(#doc{id=Id,deleted=Del,body=Body,revs={Start, RevIds},
- meta=Meta}=Doc,Options)->
- {[{<<"_id">>, Id}]
- ++ to_json_rev(Start, RevIds)
- ++ to_json_body(Del, Body)
- ++ to_json_revisions(Options, Start, RevIds)
- ++ to_json_meta(Meta)
- ++ to_json_attachments(Doc#doc.atts, Options)
+doc_to_json_obj(
Review comment:
This is verbose but this code violates CouchDB formatting rules where we
try to not match too many arguments in the function clause header. We supposed
to write the following here:
```
doc_to_json_obj(revs={Start, RevIds}, Options) ->
#doc{
id = Id,
deleted = Del,
body = Body,
meta = Meta
} = Doc,
...
```
0
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]