]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Update PiecePriority
authorMatt Joiner <anacrolix@gmail.com>
Thu, 21 Mar 2024 21:15:10 +0000 (08:15 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 21 Mar 2024 21:15:10 +0000 (08:15 +1100)
types/types.go

index 8ec7aedfc68d9b59a491e451876ad834112dc1fc..df9284a54ea543742709506586d5f1c0b390657a 100644 (file)
@@ -1,3 +1,5 @@
+// package types contains types that are used by the request strategy and the torrent package and
+// need to be shared between them.
 package types
 
 import (
@@ -35,18 +37,14 @@ func (pp *PiecePriority) Raise(maybe PiecePriority) bool {
        return false
 }
 
-// Priority for use in PriorityBitmap
-func (me PiecePriority) BitmapPriority() int {
-       return -int(me)
-}
-
 const (
        PiecePriorityNone      PiecePriority = iota // Not wanted. Must be the zero value.
        PiecePriorityNormal                         // Wanted.
        PiecePriorityHigh                           // Wanted a lot.
        PiecePriorityReadahead                      // May be required soon.
-       // Succeeds a piece where a read occurred. Currently, the same as Now, apparently due to issues
-       // with caching.
+       // Deprecated. Succeeds a piece where a read occurred. This used to prioritize the earlier
+       // pieces in the readahead window. The request strategy now does this, so it's no longer needed.
+       // There is downstream code that still assumes it's in use.
        PiecePriorityNext
        PiecePriorityNow // A Reader is reading in this piece. Highest urgency.
 )