rnewson commented on a change in pull request #1656: Partition review fixes
URL: https://github.com/apache/couchdb/pull/1656#discussion_r226226855
 
 

 ##########
 File path: src/fabric/src/fabric_view_all_docs.erl
 ##########
 @@ -148,16 +154,16 @@ shards(DbName, Args) ->
                 {_, _} ->
                     mem3:shards(DbName)
             end;
-        _ ->
-            mem3:shards(DbName)
+        {true, Partition} ->
+            mem3:shards(DbName, <<Partition/binary, ":foo">>)
     end.
 
-partition(undefined) ->
-    undefined;
-partition(null) ->
-    null;
+
 partition(Key) when is_binary(Key) ->
-    hd(binary:split(Key, <<":">>)).
+    hd(binary:split(Key, <<":">>));
+partition(_) ->
+    undefined.
 
 Review comment:
   let's be explicit here, I assume only `undefined` and `null` are likely to 
be passed, anything else is a bug we want to detect.

----------------------------------------------------------------
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