MCPcopy
hub / github.com/grafana/dskit / Equals

Method Equals

ring/tokens.go:20–36  ·  view source on GitHub ↗

Equals returns whether the tokens are equal to the input ones.

(other Tokens)

Source from the content-addressed store, hash-verified

18
19// Equals returns whether the tokens are equal to the input ones.
20func (t Tokens) Equals(other Tokens) bool {
21 if len(t) != len(other) {
22 return false
23 }
24
25 mine := t
26 sort.Sort(mine)
27 sort.Sort(other)
28
29 for i := 0; i < len(mine); i++ {
30 if mine[i] != other[i] {
31 return false
32 }
33 }
34
35 return true
36}
37
38// StoreToFile stores the tokens in the given directory.
39func (t Tokens) StoreToFile(tokenFilePath string) error {

Calls

no outgoing calls