]> Sergey Matveev's repositories - btrtrc.git/blobdiff - request-strategy/order.go
Add AjwernerBtree as an alternative btree backing for piece request order
[btrtrc.git] / request-strategy / order.go
index f9c791e5b48671b8436c4e09e6df3b483fef2ed7..130c698b9f9e6e75235ef0987fa4b68a73d762dc 100644 (file)
@@ -51,11 +51,7 @@ func GetRequestablePieces(input Input, pro *PieceRequestOrder, f func(ih metainf
                storageLeft = &cap
        }
        var allTorrentsUnverifiedBytes int64
-       min, ok := pro.tree.Min()
-       if !ok {
-               return
-       }
-       pro.tree.Ascend(min, func(_i pieceRequestOrderItem) bool {
+       pro.tree.Scan(func(_i pieceRequestOrderItem) bool {
                ih := _i.key.InfoHash
                var t Torrent = input.Torrent(ih)
                var piece Piece = t.Piece(_i.key.Index)