MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / updateSortedHashes

Method updateSortedHashes

consistent/consistent.go:363–374  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

361}
362
363func (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
376func sliceContainsMember(set []proto.Node, member proto.Node) bool {
377 for _, m := range set {

Callers 2

AddCacheMethod · 0.95
RemoveCacheMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected