You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2020/03/30 08:43:06 UTC

[GitHub] [couchdb] iilyak commented on a change in pull request #2731: All docs raw collation

iilyak commented on a change in pull request #2731: All docs raw collation
URL: https://github.com/apache/couchdb/pull/2731#discussion_r400021033
 
 

 ##########
 File path: src/fabric/src/fabric2_util.erl
 ##########
 @@ -294,13 +294,9 @@ uuid() ->
     to_hex(crypto:strong_rand_bytes(16)).
 
 
-encode_all_doc_key(null) -> <<>>;
-encode_all_doc_key(true) -> <<>>;
-encode_all_doc_key(false) -> <<>>;
-encode_all_doc_key(N) when is_number(N) -> <<>>;
 encode_all_doc_key(B) when is_binary(B) -> B;
-encode_all_doc_key(L) when is_list(L) -> <<255>>;
-encode_all_doc_key({O}) when is_list(O) -> <<255>>.
+encode_all_doc_key(Term) when Term < <<>> -> <<>>;
+encode_all_doc_key(_) -> <<255>>.
 
 Review comment:
   I don't understand why we are always returning `<<255>>` here. If we are ignoring the term itself we would have 
   `start_key == end_key == <<255>>` here https://github.com/apache/couchdb/blob/prototype/fdb-layer/src/chttpd/src/chttpd_db.erl#L952:L960. I would understand if we would have:
   ```
   encode_all_doc_key(Term) when Term < <<>> -> <<>>;
   encode_all_doc_key(B) when is_binary(B) -> B;
   encode_all_doc_key(_) -> <<255>>.
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services