2
0
mirror of synced 2025-02-23 14:18:13 +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()
if storageLeft != nil {
if *storageLeft < pieceLength {
return true
return false
}
*storageLeft -= pieceLength
}