torwig commented on code in PR #1444:
URL: 
https://github.com/apache/incubator-kvrocks/pull/1444#discussion_r1198030725


##########
src/commands/cmd_set.cc:
##########
@@ -283,6 +285,46 @@ class CommandSInter : public Commander {
   }
 };
 
+class CommandSInterCard : public Commander {
+ public:
+  Status Parse(const std::vector<std::string> &args) override {
+    auto parse_numkey = ParseInt<int>(args[1], 10);
+    if (!parse_numkey) {
+      return {Status::RedisParseErr, errValueNotInteger};
+    }
+    numkeys_ = *parse_numkey;
+
+    // command:  SINTERCARD 2 key1 key2 LIMIT 1
+    if (args.size() == numkeys_ + 4) {
+      auto parse_limit = ParseInt<int>(args[numkeys_ + 2], 10);
+      if (!parse_limit) {
+        return {Status::RedisParseErr, errValueNotInteger};
+      }
+      limit_ = std::max(0, *parse_limit);
+    }
+    return Commander::Parse(args);
+  }
+
+  Status Execute(Server *svr, Connection *conn, std::string *output) override {
+    std::vector<Slice> keys;
+    for (size_t i = 2; i < numkeys_ + 2; i++) {
+      keys.emplace_back(args_[i]);
+    }
+
+    redis::Set set_db(svr->storage, conn->GetNamespace());
+    int ret = 0;

Review Comment:
   You don't use this `ret` variable, you don't send any response to the 
command. Please, add some integration tests in Go to check the proper responses 
of the newly created command.



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