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

Method FindRevRank

sorted_set.go:804–814  ·  view source on GitHub ↗

FindRevRank Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low.

(hash uint32)

Source from the content-addressed store, hash-verified

802
803// FindRevRank Returns the rank of member in the sorted set stored at key, with the scores ordered from high to low.
804func (sl *SkipList) FindRevRank(hash uint32) int {
805 if sl.length == 0 {
806 return 0
807 }
808
809 if _, ok := sl.dict[hash]; !ok {
810 return 0
811 }
812
813 return sl.Size() - sl.FindRank(hash) + 1
814}

Callers 1

ZRevRankMethod · 0.80

Calls 2

SizeMethod · 0.95
FindRankMethod · 0.95

Tested by

no test coverage detected