iilyak commented on a change in pull request #1789: New Feature: Database 
Partitions
URL: https://github.com/apache/couchdb/pull/1789#discussion_r239436241
 
 

 ##########
 File path: src/mango/src/mango_idx.erl
 ##########
 @@ -329,6 +339,87 @@ gen_name(Idx, Opts0) ->
     mango_util:enc_hex(Sha).
 
 
+get_idx_partitioned(Opts) ->
+    case proplists:get_value(partitioned, Opts) of
+        B when is_boolean(B) ->
+            B;
+        default ->
+            undefined
 
 Review comment:
   The return value is somewhat inconsistent and could be problematic. By 
inconsistent I mean it can return either `boolean()` or `undefined`. While 
`fabric_util:is_partitioned/1` can only return `boolean()`. Non boolean value 
can be a problem if it gets into `filter_partition_indexes/2`. Since `not 
undefined` would be crashing with badarg (if Partition is `<<>>`). What is the 
reason to use ternary logic here?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to