Skip to content

Commit

Permalink
GetRequestablePieces: remove runtime correctness check (#902)
Browse files Browse the repository at this point in the history
  • Loading branch information
veshij authored Feb 9, 2024
1 parent 8c3338f commit 1416648
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions request-strategy/order.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package requestStrategy
import (
"bytes"

g "github.com/anacrolix/generics"
"github.com/anacrolix/multiless"

"github.com/anacrolix/torrent/metainfo"
Expand Down Expand Up @@ -52,16 +51,7 @@ func GetRequestablePieces(
storageLeft = &cap
}
var allTorrentsUnverifiedBytes int64
var lastItem g.Option[pieceRequestOrderItem]
pro.tree.Scan(func(_i pieceRequestOrderItem) bool {
// Check that scan emits pieces in priority order.
if lastItem.Ok {
if _i.Less(&lastItem.Value) {
panic("scan not in order")
}
}
lastItem.Set(_i)

ih := _i.key.InfoHash
var t Torrent = input.Torrent(ih)
var piece Piece = t.Piece(_i.key.Index)
Expand Down

0 comments on commit 1416648

Please sign in to comment.