()
| 361 | } |
| 362 | |
| 363 | func (c *Consistent) updateSortedHashes() { |
| 364 | hashes := c.sortedHashes[:0] |
| 365 | //reallocate if we're holding on to too much (1/4th) |
| 366 | if cap(c.sortedHashes)/(c.NumberOfReplicas*4) > len(c.circle) { |
| 367 | hashes = nil |
| 368 | } |
| 369 | for k := range c.circle { |
| 370 | hashes = append(hashes, k) |
| 371 | } |
| 372 | sort.Sort(hashes) |
| 373 | c.sortedHashes = hashes |
| 374 | } |
| 375 | |
| 376 | func sliceContainsMember(set []proto.Node, member proto.Node) bool { |
| 377 | for _, m := range set { |
no outgoing calls
no test coverage detected