Skip to content

Commit

Permalink
fix sort.Slice less comparison
Browse files Browse the repository at this point in the history
Co-authored-by: Marco Munizaga <git@marcopolo.io>
  • Loading branch information
marten-seemann and MarcoPolo authored Apr 5, 2023
1 parent 715e17c commit 10cdaeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/host/basic/basic_host.go
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ func dedupAddrs(addrs []ma.Multiaddr) []ma.Multiaddr {
if len(addrs) == 0 {
return addrs
}
sort.Slice(addrs, func(i, j int) bool { return bytes.Compare(addrs[i].Bytes(), addrs[j].Bytes()) <= 0 })
sort.Slice(addrs, func(i, j int) bool { return bytes.Compare(addrs[i].Bytes(), addrs[j].Bytes()) < 0 })
idx := 1
for i := 1; i < len(addrs); i++ {
if !addrs[i-1].Equal(addrs[i]) {
Expand Down

0 comments on commit 10cdaeb

Please sign in to comment.