infdahai commented on code in PR #1492:
URL: 
https://github.com/apache/incubator-kvrocks/pull/1492#discussion_r1228516547


##########
src/commands/cmd_zset.cc:
##########
@@ -555,9 +561,17 @@ class CommandZRangeGeneric : public Commander {
         s = zset_db.RangeByRank(key_, rank_spec_, &member_scores, nullptr);
         break;
       case kZRangeScore:
+        if (score_spec_.count == 0) {
+          *output = redis::EmptyArray();
+          return Status::OK();
+        }
         s = zset_db.RangeByScore(key_, score_spec_, &member_scores, nullptr);
         break;
       case kZRangeLex:
+        if (lex_spec_.count == 0) {
+          *output = redis::EmptyArray();

Review Comment:
   we can use `std::vector<std::string> values; *output 
=MultiBulkString(values, false)` to do the same thing.
   I'm not sure if I want to add the specific `EmptyArray`.



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