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

Method ZScore

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

Source from the content-addressed store, hash-verified

244}
245
246func (z *SortedSet) ZScore(key string, value []byte) (float64, error) {
247 if sortedSet, ok := z.M[key]; ok {
248 node := sortedSet.GetByValue(value)
249 if node != nil {
250 return float64(sortedSet.GetByValue(value).score), nil
251 }
252 return 0, ErrSortedSetMemberNotExist
253 }
254 return 0, ErrSortedSetNotFound
255}
256
257func (z *SortedSet) ZExist(key string, value []byte) (bool, error) {
258 if sortedSet, ok := z.M[key]; ok {

Callers

nothing calls this directly

Calls 1

GetByValueMethod · 0.80

Tested by

no test coverage detected