Merge pull request #1341 from EugeneChung/develop

Remove unnecessary bytes.Compare() call
This commit is contained in:
Alexander Simmerl
2018-03-20 16:27:06 +01:00
committed by GitHub

View File

@@ -45,9 +45,10 @@ func (v *Validator) CompareAccum(other *Validator) *Validator {
} else if v.Accum < other.Accum {
return other
} else {
if bytes.Compare(v.Address, other.Address) < 0 {
result := bytes.Compare(v.Address, other.Address)
if result < 0 {
return v
} else if bytes.Compare(v.Address, other.Address) > 0 {
} else if result > 0 {
return other
} else {
cmn.PanicSanity("Cannot compare identical validators")