Remove unnecessary bytes.Compare() call

This commit is contained in:
Eugene Chung 2018-03-20 23:43:18 +09:00 committed by GitHub
parent 5a51a0ba06
commit a61130aebb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

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