Skip to content

Commit

Permalink
Stop iterating pieces when storage is exhausted
Browse files Browse the repository at this point in the history
  • Loading branch information
anacrolix committed Dec 12, 2021
1 parent 135f21f commit 8025d15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion request-strategy/order.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 8025d15

Please sign in to comment.