]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Stop iterating pieces when storage is exhausted
authorMatt Joiner <anacrolix@gmail.com>
Wed, 1 Dec 2021 08:31:29 +0000 (19:31 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Sun, 12 Dec 2021 07:35:01 +0000 (18:35 +1100)
request-strategy/order.go

index 4a86aae97c20d69e4bb62fcc063630b88892af11..f414226da0700a906cacee99560784eabc9f9f71 100644 (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
                }