You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "PragmaTwice (via GitHub)" <gi...@apache.org> on 2025/12/30 15:15:37 UTC
Re: [PR] feat(delex): Implement DELEX Command [kvrocks]
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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org