PragmaTwice commented on code in PR #2236:
URL: https://github.com/apache/kvrocks/pull/2236#discussion_r1562406664


##########
src/commands/cmd_server.cc:
##########
@@ -820,24 +820,28 @@ class CommandScan : public CommandScanBase {
   CommandScan() : CommandScanBase() {}
 
   Status Parse(const std::vector<std::string> &args) override {
-    if (args.size() % 2 != 0) {
-      return {Status::RedisParseErr, errWrongNumOfArguments};
-    }
-
-    ParseCursor(args[1]);
-    if (args.size() >= 4) {
-      Status s = ParseMatchAndCountParam(util::ToLower(args[2]), args_[3]);
-      if (!s.IsOK()) {
-        return s;
+    CommandParser parser(args, 1);
+    ParseCursor(GET_OR_RET(parser.TakeStr()));
+    while (parser.Good()) {
+      if (parser.EatEqICase("match")) {
+        prefix_ = GET_OR_RET(parser.TakeStr());
+        if (!prefix_.empty() && prefix_[prefix_.size() - 1] == '*') {

Review Comment:
   ```suggestion
           if (!prefix_.empty() && prefix_.back() == '*') {
   ```



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