2
0
mirror of synced 2025-02-24 06:38:14 +00:00

Stop iterating pieces when storage is exhausted

This commit is contained in:
Matt Joiner 2021-12-01 19:31:29 +11:00
parent 135f21fb64
commit 8025d15155

View File

@ -88,7 +88,7 @@ func GetRequestablePieces(input Input, pro *PieceRequestOrder, f func(ih metainf
pieceLength := t.PieceLength() pieceLength := t.PieceLength()
if storageLeft != nil { if storageLeft != nil {
if *storageLeft < pieceLength { if *storageLeft < pieceLength {
return true return false
} }
*storageLeft -= pieceLength *storageLeft -= pieceLength
} }