From 23a0e7f7d3d32ecb94550f7c99261a7930fc43e5 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 9 May 2022 10:51:50 +1000 Subject: [PATCH] Remove redundant type conversions --- request-strategy/order.go | 2 +- torrent.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/request-strategy/order.go b/request-strategy/order.go index a23d5117..c276da91 100644 --- a/request-strategy/order.go +++ b/request-strategy/order.go @@ -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 { diff --git a/torrent.go b/torrent.go index b54e8bbc..81e80ddb 100644 --- a/torrent.go +++ b/torrent.go @@ -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() -- 2.44.0