Reuse pieceRequestOrder slice
This commit is contained in:
parent
99a7cb9291
commit
875ead3582
|
@ -81,6 +81,8 @@ type Client struct {
|
|||
websocketTrackers websocketTrackers
|
||||
|
||||
activeAnnounceLimiter limiter.Instance
|
||||
|
||||
pieceRequestOrder clientPieceRequestOrder
|
||||
}
|
||||
|
||||
type ipStr string
|
||||
|
|
|
@ -87,7 +87,8 @@ func (cl *Client) requester() {
|
|||
}
|
||||
|
||||
func (cl *Client) doRequests() {
|
||||
requestOrder := clientPieceRequestOrder{}
|
||||
requestOrder := &cl.pieceRequestOrder
|
||||
requestOrder.pieces = requestOrder.pieces[:0]
|
||||
allPeers := make(map[*Torrent][]*Peer)
|
||||
// Storage capacity left for this run, keyed by the storage capacity pointer on the storage
|
||||
// TorrentImpl.
|
||||
|
|
Loading…
Reference in New Issue