MCPcopy Create free account
hub / github.com/ByteStorage/FlyDB / getMinMaxScore

Method getMinMaxScore

structure/zset.go:980–990  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

978 return zSet.max(min, minScore), zSet.min(max, maxScore), nil
979}
980func (fzs *FZSet) getMinMaxScore() (minScore int, maxScore int) {
981 if fzs == nil || fzs.skipList == nil || fzs.skipList.head == nil || len(fzs.skipList.head.level) < 1 || fzs.skipList.head.level[0].next == nil || fzs.skipList.tail == nil {
982 return 0, 0
983 }
984
985 if fzs.skipList.head.level[0].next.value == nil || fzs.skipList.tail.value == nil {
986 return 0, 0
987 }
988 return fzs.skipList.head.level[0].next.value.score,
989 fzs.skipList.tail.value.score
990}
991func (fzs *FZSet) min(a, b int) int {
992 if a < b {
993 return a

Callers 2

TestFZSetMinMaxFunction · 0.95
adjustMinMaxMethod · 0.80

Calls

no outgoing calls

Tested by 1

TestFZSetMinMaxFunction · 0.76