Skip to content

Commit ebcf0ba

Browse files
committed
XDPoS/utils: use common.Address.Cmp for slices.SortFunc
1 parent 22edaac commit ebcf0ba

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

consensus/XDPoS/utils/utils.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,8 @@ func CompareSignersLists(list1 []common.Address, list2 []common.Address) bool {
6666
l1 := slices.Clone(list1)
6767
l2 := slices.Clone(list2)
6868

69-
slices.SortFunc(l1, func(a, b common.Address) int {
70-
return bytes.Compare(a[:], b[:])
71-
})
72-
slices.SortFunc(l2, func(a, b common.Address) int {
73-
return bytes.Compare(a[:], b[:])
74-
})
69+
slices.SortFunc(l1, common.Address.Cmp)
70+
slices.SortFunc(l2, common.Address.Cmp)
7571

7672
return slices.Equal(l1, l2)
7773
}

0 commit comments

Comments
 (0)