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


##########
src/commands/cmd_string.cc:
##########
@@ -108,6 +108,56 @@ class CommandGetEx : public Commander {
   std::optional<uint64_t> expire_;
 };
 
+class CommandDelEX : public Commander {
+ public:
+  Status Parse(const std::vector<std::string> &args) override {
+    if (args.size() > 4) {
+      return {Status::RedisParseErr, errWrongNumOfArguments};
+    }
+
+    CommandParser parser(args, 2);
+    while (parser.Good()) {
+      if (parser.EatEqICase("ifdeq")) {
+        opt_ = '1';
+        hash_or_val_ = GET_OR_RET(parser.TakeStr());
+      } else if (parser.EatEqICase("ifdne")) {
+        opt_ = '2';
+        hash_or_val_ = GET_OR_RET(parser.TakeStr());
+      } else if (parser.EatEqICase("ifeq")) {
+        opt_ = '3';
+        hash_or_val_ = GET_OR_RET(parser.TakeStr());
+      } else if (parser.EatEqICase("ifne")) {
+        opt_ = '4';
+        hash_or_val_ = GET_OR_RET(parser.TakeStr());
+      } else {
+        return {Status::RedisParseErr, errInvalidSyntax};

Review Comment:
   Please use an `enum class` instead of meaningless chars like `1`, `2`, `3`, 
`4`.



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