git-hulk commented on code in PR #2819:
URL: https://github.com/apache/kvrocks/pull/2819#discussion_r1984621651
##########
src/commands/cmd_key.cc:
##########
@@ -336,6 +336,30 @@ class CommandPersist : public Commander {
}
};
+class CommandDelPrefix : public Commander {
+ public:
+ Status Execute(engine::Context &ctx, Server *srv, Connection *conn,
std::string *output) override {
+ if (args_.size() != 2) {
+ return {Status::RedisParseErr, "wrong number of arguments for
'DELPREFIX' command"};
+ }
+
+ std::string prefix = args_[1];
+ auto storage = srv->storage;
+ std::string start_key = prefix;
+ std::string end_key = prefix;
+ end_key.back()++;
Review Comment:
Looks like this line was intended to calculate the boundary of the end key.
If so, you could use `StringNext` in the common dir.
--
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]