Bug fix : ZPOPMIN command.

Fixed the error caused by incorrect "boder" pass value.
And added a simple unit test to verify correctness.
This commit is contained in:
kaniu
2022-11-23 16:11:05 +08:00
committed by finley
parent febb83cb5c
commit 122d6ba505
2 changed files with 17 additions and 1 deletions

View File

@@ -220,7 +220,7 @@ func (sortedSet *SortedSet) PopMin(count int) []*Element {
Value: first.Score,
Exclude: false,
}
removed := sortedSet.skiplist.RemoveRangeByScore(border, border, count)
removed := sortedSet.skiplist.RemoveRangeByScore(border, positiveInfBorder, count)
for _, element := range removed {
delete(sortedSet.dict, element.Member)
}