Closed chejinge closed 1 week ago
This update includes modifications to the Redis::ZRevrank
method in redis_zsets.cc
, specifically altering the loop condition logic. Additionally, a new test case is introduced in zset_test.go
to cover a variety of ZSET-related operations in Redis, providing more comprehensive test coverage for commands like ZREVRANK, ZRank, ZRevRank, ZScan, ZCard, and ZAdd.
Files | Change Summary |
---|---|
src/storage/src/redis_zsets.cc |
Modified the loop condition in Redis::ZRevrank method from left >= 0 to left > 0 , affecting the iteration logic and termination. |
tests/integration/zset_test.go |
Introduced a new test case covering ZSET operations including ZREVRANK, ZRank, ZRevRank, ZScan, ZCard, and ZAdd. |
sequenceDiagram
participant Client as Client
participant Redis as Redis Server
participant Zsets as ZSets Module
Client->>Redis: Send ZREVRANK Command
Redis->>Zsets: Call ZRevrank Method
Zsets->>Redis: Return Rank (new loop condition applied)
Redis->>Client: Respond with Rank
Client->>Redis: Send ZADD Command
Redis->>Zsets: Update ZSets
Zsets->>Redis: Acknowledge Update
Redis->>Client: Respond with Status
Client->>Redis: Send ZSCAN Command
Redis->>Zsets: Call ZScan Method
Zsets->>Redis: Return Scan Results
Redis->>Client: Respond with Scan Results
In the land of code where logic bends,
Redis found a loop that ends.
Withleft > 0
it now will flow,
A smarter way for ranks to show.
Tests arise like dawn's first light,
Ensuring ZSETs will work just right.
Hats off to code, where changes gleam,
In every byte, a coder's dream. 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
https://github.com/OpenAtomFoundation/pika/issues/2762
Summary by CodeRabbit
Bug Fixes
ZRevrank
method to enhance the iteration logic and termination conditions.Tests