From 1416648d314fc791c680bdde07abd3db545ff694 Mon Sep 17 00:00:00 2001 From: Oleg Guba Date: Thu, 8 Feb 2024 20:44:09 -0800 Subject: [PATCH] GetRequestablePieces: remove runtime correctness check (#902) --- request-strategy/order.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/request-strategy/order.go b/request-strategy/order.go index e5c4792f..eb4d1b7f 100644 --- a/request-strategy/order.go +++ b/request-strategy/order.go @@ -3,7 +3,6 @@ package requestStrategy import ( "bytes" - g "github.com/anacrolix/generics" "github.com/anacrolix/multiless" "github.com/anacrolix/torrent/metainfo" @@ -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) -- 2.48.1