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

Method adjustMinMax

structure/zset.go:973–979  ·  view source on GitHub ↗
(zSet *FZSet, min int, max int)

Source from the content-addressed store, hash-verified

971 return nil
972}
973func (zs *ZSetStructure) adjustMinMax(zSet *FZSet, min int, max int) (adjustedMin int, adjustedMax int, err error) {
974 if min > max {
975 return min, max, ErrInvalidArgs
976 }
977 minScore, maxScore := zSet.getMinMaxScore()
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

Callers 2

ZCountMethod · 0.95

Calls 3

getMinMaxScoreMethod · 0.80
maxMethod · 0.45
minMethod · 0.45

Tested by 1