func sortableIndices.Less is unused
27func (s sortableIndices) Swap(i, j int) { s.indices[i], s.indices[j] = s.indices[j], s.indices[i] }
28
29// Less reports whether the element with index i must sort before the element with index j.
30func (s sortableIndices) Less(i, j int) bool { 31 if s.validators[s.indices[i]].ActivationEligibilityEpoch == s.validators[s.indices[j]].ActivationEligibilityEpoch {
32 return s.indices[i] < s.indices[j]
33 }
func sortableIndices.Swap is unused
24func (s sortableIndices) Len() int { return len(s.indices) }
25
26// Swap swaps the elements with indexes i and j.
27func (s sortableIndices) Swap(i, j int) { s.indices[i], s.indices[j] = s.indices[j], s.indices[i] } 28
29// Less reports whether the element with index i must sort before the element with index j.
30func (s sortableIndices) Less(i, j int) bool {
func sortableIndices.Len is unused
21}
22
23// Len is the number of elements in the collection.
24func (s sortableIndices) Len() int { return len(s.indices) } 25
26// Swap swaps the elements with indexes i and j.
27func (s sortableIndices) Swap(i, j int) { s.indices[i], s.indices[j] = s.indices[j], s.indices[i] }
type sortableIndices is unused
15
16// sortableIndices implements the Sort interface to sort newly activated validator indices
17// by activation epoch and by index number.
18type sortableIndices struct { 19 indices []primitives.ValidatorIndex
20 validators []*ethpb.Validator
21}
Description
It is recommended to keep the codebase clean by removing unused code.
This part of the code has not been used anywhere in the project and is not exported. Maybe it was mistakenly left behind while refactoring or was intended to be used somewhere but remained unused by mistake.