removeFromSortedSet removes a hash value from the sorted set of hashes.
(hashValue uint64)
| 299 | |
| 300 | // removeFromSortedSet removes a hash value from the sorted set of hashes. |
| 301 | func (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. |