Use pointer receiver for peerRequests.{Less,Len}

This commit is contained in:
Matt Joiner 2021-10-12 13:06:32 +11:00
parent 3f3bcab0d8
commit 464e1297b0
1 changed files with 2 additions and 2 deletions

View File

@ -127,11 +127,11 @@ type peerRequests struct {
torrentStrategyInput request_strategy.Torrent
}
func (p peerRequests) Len() int {
func (p *peerRequests) Len() int {
return len(p.requestIndexes)
}
func (p peerRequests) Less(i, j int) bool {
func (p *peerRequests) Less(i, j int) bool {
leftRequest := p.requestIndexes[i]
rightRequest := p.requestIndexes[j]
t := p.peer.t