Skip to content

Commit

Permalink
change function SendMenberWithScores in class CommandZPop
Browse files Browse the repository at this point in the history
  • Loading branch information
Yangsx-1 committed Jun 16, 2023
1 parent 339c57b commit 7cebbd5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/commands/cmd_zset.cc
Original file line number Diff line number Diff line change
Expand Up @@ -319,11 +319,12 @@ class CommandZPop : public Commander,

void SendMembersWithScores(const std::vector<MemberScore> &member_scores, const std::string &userkey) {
std::string output;
if (block_)
if (block_) {
output.append(redis::MultiLen(member_scores.size() * 2 + 1));
else
output.append(redis::BulkString(userkey));
} else {
output.append(redis::MultiLen(member_scores.size() * 2));
if (block_) output.append(redis::BulkString(userkey));
}
for (const auto &ms : member_scores) {
output.append(redis::BulkString(ms.member));
output.append(redis::BulkString(util::Float2String(ms.score)));
Expand Down

0 comments on commit 7cebbd5

Please sign in to comment.