Remove redundant type conversions

This commit is contained in:
Matt Joiner 2022-05-09 10:51:50 +10:00
parent daff06cf20
commit 23a0e7f7d3
No known key found for this signature in database
GPG Key ID: 6B990B8185E7F782
2 changed files with 3 additions and 3 deletions

View 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 {

View 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()