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

Method ZRem

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

Source from the content-addressed store, hash-verified

180}
181
182func (z *SortedSet) ZRem(key string, value []byte) (*core.Record, error) {
183 if sortedSet, ok := z.M[key]; ok {
184 hash, err := utils.GetFnv32(value)
185 if err != nil {
186 return nil, err
187 }
188 node := sortedSet.Remove(hash)
189 if node != nil {
190 return node.record, nil
191 }
192 return nil, ErrSortedSetMemberNotExist
193 }
194
195 return nil, ErrSortedSetNotFound
196}
197
198func (z *SortedSet) ZRemRangeByRank(key string, start int, end int) error {
199 if sortedSet, ok := z.M[key]; ok {

Callers

nothing calls this directly

Calls 2

GetFnv32Function · 0.92
RemoveMethod · 0.45

Tested by

no test coverage detected