You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/11/13 14:13:47 UTC

[GitHub] [incubator-kvrocks] PragmaTwice commented on a diff in pull request #1119: Support more `ZRANGE` options

PragmaTwice commented on code in PR #1119:
URL: https://github.com/apache/incubator-kvrocks/pull/1119#discussion_r1020909949


##########
src/commands/redis_cmd.cc:
##########
@@ -2554,44 +2555,119 @@ class CommandZRange : public Commander {
   explicit CommandZRange(bool reversed = false) : reversed_(reversed) {}
 
   Status Parse(const std::vector<std::string> &args) override {
-    auto parse_start = ParseInt<int>(args[2], 10);
-    auto parse_stop = ParseInt<int>(args[3], 10);
-    if (!parse_start || !parse_stop) {
-      return Status(Status::RedisParseErr, errValueNotInteger);
+    CommandParser parser(args, 4);
+    while (parser.Good()) {
+      if (parser.EatEqICaseFlag("BYSCORE", by_flag_)) {
+        by_flag_ = "BYSCORE";
+      } else if (parser.EatEqICase("BYLEX")) {
+        by_flag_ = "BYLEX";

Review Comment:
   ```suggestion
         if (parser.EatEqICaseFlag("BYSCORE", by_flag_)) {
         } else if (parser.EatEqICaseFlag("BYLEX", by_flag_)) {
   ```



-- 
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: issues-unsubscribe@kvrocks.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org