torwig commented on code in PR #1492:
URL:
https://github.com/apache/incubator-kvrocks/pull/1492#discussion_r1229338461
##########
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:
The third option is just `*output = MultiBulkString({});` since the array is
empty and there is no need to care whether use an empty string or nil.
Other changes are good to me as well.
--
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]