davisp commented on a change in pull request #1110: Make _design_docs to 
respect query parameters
URL: https://github.com/apache/couchdb/pull/1110#discussion_r164165369
 
 

 ##########
 File path: src/couch/src/couch_db.erl
 ##########
 @@ -1738,14 +1738,28 @@ do_pipe([Filter|Rest], F0) ->
 
 set_namespace_range(Options, undefined) -> Options;
 set_namespace_range(Options, NS) ->
-    %% FIXME depending on order we might need to swap keys
-    SK = select_gt(
-           proplists:get_value(start_key, Options, <<"">>),
-           <<NS/binary, "/">>),
-    EK = select_lt(
-           proplists:get_value(end_key, Options, <<NS/binary, "0">>),
-           <<NS/binary, "0">>),
-    [{start_key, SK}, {end_key_gt, EK}].
+    SK0 = proplists:get_value(start_key, Options, <<NS/binary, "/">>),
+    EKType = case proplists:get_value(end_key_gt, Options) of
+        undefined -> end_key;
+        _ -> end_key_gt
+    end,
+    EK0 = case EKType of
+        end_key -> proplists:get_value(end_key, Options, <<NS/binary, "0">>);
 
 Review comment:
   Oops. Missed this style nit. Move the proplists:get_value to a new line 
here. We prefer to have all clauses be inline or multiline because when they're 
mixed its easy to mis the inline clauses.

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