MCPcopy Create free account
hub / github.com/nutsdb/nutsdb / sanitizeIndexes

Method sanitizeIndexes

sorted_set.go:736–751  ·  view source on GitHub ↗
(start, end int)

Source from the content-addressed store, hash-verified

734}
735
736func (sl *SkipList) sanitizeIndexes(start, end int) (newStart, newEnd int) {
737 if start < 0 {
738 start = int(sl.length) + start + 1
739 }
740 if end < 0 {
741 end = int(sl.length) + end + 1
742 }
743 if start <= 0 {
744 start = 1
745 }
746 if end <= 0 {
747 end = 1
748 }
749
750 return start, end
751}
752
753// GetByRank returns the node at given rank.
754// Note that the rank is 1-based integer. Rank 1 means the first node; Rank -1 means the last node.

Callers 1

GetByRankRangeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected