4 "github.com/anacrolix/torrent/typed-roaring"
7 // Use an iterator to jump between dirty bits.
8 type undirtiedChunksIter struct {
9 TorrentDirtyChunks *typedRoaring.Bitmap[RequestIndex]
10 StartRequestIndex RequestIndex
11 EndRequestIndex RequestIndex
14 func (me *undirtiedChunksIter) Iter(f func(chunkIndexType)) {
15 it := me.TorrentDirtyChunks.Iterator()
16 startIndex := me.StartRequestIndex
17 endIndex := me.EndRequestIndex
18 it.AdvanceIfNeeded(startIndex)
19 lastDirty := startIndex - 1
25 for index := lastDirty + 1; index < next; index++ {
30 for index := lastDirty + 1; index < endIndex; index++ {