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


##########
src/commands/cmd_replication.cc:
##########
@@ -344,10 +344,56 @@ class CommandDBName : public Commander {
   }
 };
 
+class CommandWait : public Commander {
+ public:
+  Status Parse(const std::vector<std::string> &args) override {
+    auto num_replicas_result = ParseInt<int>(args[1], 10);
+    if (!num_replicas_result) {
+      return {Status::RedisParseErr, "numreplicas should be a positive 
integer"};
+    }
+    num_replicas_ = *num_replicas_result;
+    if (num_replicas_ < 0) {
+      return {Status::RedisParseErr, "numreplicas should be a positive 
integer"};
+    }

Review Comment:
   Also, if it is a value that should be non-negative, consider to use `size_t` 
or `uintN_t`. Then we don't need this check.



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