type peerRequests struct {
requestIndexes []RequestIndex
peer *Peer
- torrentStrategyInput request_strategy.Torrent
+ torrentStrategyInput *request_strategy.Torrent
}
func (p *peerRequests) Len() int {
requestHeap := peerRequests{
peer: p,
}
- for _, t := range input.Torrents {
+ for i := range input.Torrents {
+ t := &input.Torrents[i]
if t.InfoHash == p.t.infoHash {
requestHeap.torrentStrategyInput = t
break