}
}
+func (me *clientPieceRequestOrder) Len() int {
+ return len(me.pieces)
+}
+
func (me *clientPieceRequestOrder) removePieces(t *Torrent) {
newPieces := make([]pieceRequestOrderPiece, 0, len(me.pieces)-t.numPieces())
for _, p := range me.pieces {
// For a given piece, the set of allPeers indices that absorbed requests for the piece.
contributed := make(map[int]struct{})
for _, p := range requestOrder.pieces {
- if p.t.ignorePieceForRequests(p.index) {
- continue
- }
peers := allPeers[p.t]
torrentPiece := p.t.piece(p.index)
if left := storageLeft[p.t.storage.Capacity]; left != nil {
}
*left -= int64(torrentPiece.length())
}
+ if p.t.ignorePieceForRequests(p.index) {
+ continue
+ }
p.t.piece(p.index).iterUndirtiedChunks(func(chunk ChunkSpec) bool {
req := Request{pp.Integer(p.index), chunk}
const skipAlreadyRequested = false