]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Remove redundant type conversions
authorMatt Joiner <anacrolix@gmail.com>
Mon, 9 May 2022 00:51:50 +0000 (10:51 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 9 May 2022 02:51:02 +0000 (12:51 +1000)
request-strategy/order.go
torrent.go

index a23d5117da48e82afd0d41c146cef9d77edba2ad..c276da91587104087170d1b913cf9f10526c17cb 100644 (file)
@@ -53,7 +53,7 @@ func GetRequestablePieces(input Input, pro *PieceRequestOrder, f func(ih metainf
        var allTorrentsUnverifiedBytes int64
        pro.tree.Scan(func(_i pieceRequestOrderItem) bool {
                ih := _i.key.InfoHash
-               var t Torrent = input.Torrent(ih)
+               var t = input.Torrent(ih)
                pieceLength := t.PieceLength()
                if storageLeft != nil {
                        if *storageLeft < pieceLength {
index b54e8bbc45178ac94aa963de026542b7d19eb5e4..81e80ddb038476de2291b622424070412921c447 100644 (file)
@@ -463,10 +463,10 @@ func (t *Torrent) onSetInfo() {
                }
                p.relativeAvailability = t.selectivePieceAvailabilityFromPeers(i)
                t.addRequestOrderPiece(i)
-               t.updatePieceCompletion(pieceIndex(i))
+               t.updatePieceCompletion(i)
                if !t.initialPieceCheckDisabled && !p.storageCompletionOk {
                        // t.logger.Printf("piece %s completion unknown, queueing check", p)
-                       t.queuePieceCheck(pieceIndex(i))
+                       t.queuePieceCheck(i)
                }
        }
        t.cl.event.Broadcast()