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

Method ZRevRank

sorted_set.go:231–244  ·  view source on GitHub ↗
(key string, value []byte)

Source from the content-addressed store, hash-verified

229}
230
231func (z *SortedSet) ZRevRank(key string, value []byte) (int, error) {
232 if sortedSet, ok := z.M[key]; ok {
233 hash, err := utils.GetFnv32(value)
234 if err != nil {
235 return 0, err
236 }
237 rank := sortedSet.FindRevRank(hash)
238 if rank == 0 {
239 return 0, ErrSortedSetMemberNotExist
240 }
241 return rank, nil
242 }
243 return 0, ErrSortedSetNotFound
244}
245
246func (z *SortedSet) ZScore(key string, value []byte) (float64, error) {
247 if sortedSet, ok := z.M[key]; ok {

Callers

nothing calls this directly

Calls 2

GetFnv32Function · 0.92
FindRevRankMethod · 0.80

Tested by

no test coverage detected