Switch from missinggo/MultiLess to anacrolix/multiless

This commit is contained in:
Matt Joiner 2022-01-12 15:07:26 +11:00
parent 83a8284d6a
commit c17186bf85
2 changed files with 4 additions and 11 deletions

View File

@ -1,7 +0,0 @@
package torrent
import "github.com/anacrolix/missinggo/v2"
type (
multiLess = missinggo.MultiLess
)

View File

@ -222,10 +222,10 @@ func (cn *PeerConn) isPreferredDirection() bool {
// considering only their networking properties. If ok is false, we can't
// decide.
func (l *PeerConn) hasPreferredNetworkOver(r *PeerConn) bool {
var ml multiLess
ml.NextBool(l.isPreferredDirection(), r.isPreferredDirection())
ml.NextBool(!l.utp(), !r.utp())
ml.NextBool(l.ipv6(), r.ipv6())
var ml multiless.Computation
ml = ml.Bool(r.isPreferredDirection(), l.isPreferredDirection())
ml = ml.Bool(l.utp(), r.utp())
ml = ml.Bool(r.ipv6(), l.ipv6())
return ml.Less()
}