MCPcopy Create free account
hub / github.com/Permify/permify / removeFromSortedSet

Method removeFromSortedSet

pkg/consistent/consistent.go:301–309  ·  view source on GitHub ↗

removeFromSortedSet removes a hash value from the sorted set of hashes.

(hashValue uint64)

Source from the content-addressed store, hash-verified

299
300// removeFromSortedSet removes a hash value from the sorted set of hashes.
301func (c *Consistent) removeFromSortedSet(hashValue uint64) {
302 for i := 0; i < len(c.sortedSet); i++ {
303 if c.sortedSet[i] == hashValue {
304 // Remove the hash value by slicing the sorted set.
305 c.sortedSet = append(c.sortedSet[:i], c.sortedSet[i+1:]...)
306 break
307 }
308 }
309}
310
311// Remove deletes a member from the consistent hash circle and redistributes partitions.
312// If the member does not exist, the method exits early.

Callers 1

RemoveMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected