Skip to content

Commit 0b06bc3

Browse files
gzliudanwgr523
authored andcommitted
not compare strings in func CompareSignersLists
1 parent 320b358 commit 0b06bc3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

consensus/XDPoS/utils/utils.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ func CompareSignersLists(list1 []common.Address, list2 []common.Address) bool {
6868
}
6969

7070
sort.Slice(l1, func(i, j int) bool {
71-
return l1[i].String() <= l1[j].String()
71+
return bytes.Compare(l1[i][:], l1[j][:]) == -1
7272
})
7373
sort.Slice(l2, func(i, j int) bool {
74-
return l2[i].String() <= l2[j].String()
74+
return bytes.Compare(l2[i][:], l2[j][:]) == -1
7575
})
7676
return reflect.DeepEqual(l1, l2)
7777
}

0 commit comments

Comments
 (0)