From a61130aebb151dfa0f8f0265d8cdda34d827e340 Mon Sep 17 00:00:00 2001 From: Eugene Chung Date: Tue, 20 Mar 2018 23:43:18 +0900 Subject: [PATCH] Remove unnecessary bytes.Compare() call --- types/validator.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/validator.go b/types/validator.go index 027f7dc3c..a9b42fe8c 100644 --- a/types/validator.go +++ b/types/validator.go @@ -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")