rnewson commented on code in PR #4414:
URL: https://github.com/apache/couchdb/pull/4414#discussion_r1149495345


##########
src/couch_mrview/src/couch_mrview_http.erl:
##########
@@ -530,9 +551,20 @@ parse_param(Key, Val, Args, IsDecoded) ->
             JsonKey = ?JSON_DECODE(Val),
             Args#mrargs{start_key = JsonKey, end_key = JsonKey};
         "keys" when IsDecoded ->
-            Args#mrargs{keys = Val};
+            case Val of
+                [Val1] ->
+                    Args#mrargs{start_key = Val1, end_key = Val1};
+                _ ->
+                    Args#mrargs{keys = Val}
+            end;
         "keys" ->
-            Args#mrargs{keys = ?JSON_DECODE(Val)};
+            Val1 = ?JSON_DECODE(Val),
+            case Val1 of
+                [Val2] ->

Review Comment:
   `Key` would be a better name for `Val2` here. I'd also inline the 
?JSON_DECODE so we don't need a `Val1`



##########
src/couch_mrview/src/couch_mrview_http.erl:
##########
@@ -530,9 +551,20 @@ parse_param(Key, Val, Args, IsDecoded) ->
             JsonKey = ?JSON_DECODE(Val),
             Args#mrargs{start_key = JsonKey, end_key = JsonKey};
         "keys" when IsDecoded ->
-            Args#mrargs{keys = Val};
+            case Val of
+                [Val1] ->

Review Comment:
   `Key` would be a better name for `Val1` here.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to