You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by GitBox <gi...@apache.org> on 2022/11/24 14:19:11 UTC
[GitHub] [incubator-kvrocks] torwig commented on a diff in pull request #1137: Tidy files inside src/commands
torwig commented on code in PR #1137:
URL: https://github.com/apache/incubator-kvrocks/pull/1137#discussion_r1031563446
##########
src/commands/redis_cmd.cc:
##########
@@ -632,20 +659,23 @@ class CommandPSetEX : public Commander {
Status Parse(const std::vector<std::string> &args) override {
auto ttl_ms = ParseInt<int64_t>(args[2], 10);
if (!ttl_ms) {
- return Status(Status::RedisParseErr, errValueNotInteger);
+ return {Status::RedisParseErr, errValueNotInteger};
}
- if (*ttl_ms <= 0) return Status(Status::RedisParseErr, errInvalidExpireTime);
- if (*ttl_ms > 0 && *ttl_ms < 1000) {
+
+ if (*ttl_ms <= 0) return {Status::RedisParseErr, errInvalidExpireTime};
+
+ if (*ttl_ms < 1000) {
Review Comment:
Because the condition `*ttl_ms <= 0` was checked a few lines before, here we can omit the `*ttl_ms > 0` 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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org