dragonfly
dragonfly copied to clipboard
fix(set): fix random in SRANDMEMBER and SPOP commands
fixes dragonflydb#3018
- For
IntSet
, the time complexity isO(n)
(n
- number of elements to return/remove). The space complexity is alsoO(n)
- For
StrSet
, the time complexity isO(m)
(m
- number of elements in set). The space complexity isO(n)
Fix a bug where replicas remove other elements during SPOP
. Now all the tests are passed. @dranikpg , please take a look.