MCPcopy Create free account
hub / github.com/tendermint/tendermint / Less

Method Less

types/validator_set.go:754–759  ·  view source on GitHub ↗
(i, j int)

Source from the content-addressed store, hash-verified

752func (valz ValidatorsByVotingPower) Len() int { return len(valz) }
753
754func (valz ValidatorsByVotingPower) Less(i, j int) bool {
755 if valz[i].VotingPower == valz[j].VotingPower {
756 return bytes.Compare(valz[i].Address, valz[j].Address) == -1
757 }
758 return valz[i].VotingPower > valz[j].VotingPower
759}
760
761func (valz ValidatorsByVotingPower) Swap(i, j int) {
762 valz[i], valz[j] = valz[j], valz[i]

Callers

nothing calls this directly

Calls 1

CompareMethod · 0.65

Tested by

no test coverage detected