Use pointer receiver for peerRequests.{Less,Len}
This commit is contained in:
parent
3f3bcab0d8
commit
464e1297b0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue