MCPcopy Create free account
hub / github.com/cortexproject/cortex / tokensEqual

Function tokensEqual

pkg/ring/model.go:355–365  ·  view source on GitHub ↗

tokensEqual checks for equality of two slices. Assumes the slices are sorted.

(lhs, rhs []uint32)

Source from the content-addressed store, hash-verified

353
354// tokensEqual checks for equality of two slices. Assumes the slices are sorted.
355func tokensEqual(lhs, rhs []uint32) bool {
356 if len(lhs) != len(rhs) {
357 return false
358 }
359 for i := range lhs {
360 if lhs[i] != rhs[i] {
361 return false
362 }
363 }
364 return true
365}
366
367var tokenMapPool = sync.Pool{New: func() any { return make(map[uint32]struct{}) }}
368

Callers 2

mergeWithTimeMethod · 0.85
FindDifferenceMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected