]> Sergey Matveev's repositories - btrtrc.git/blob - common/upverted_files.go
Drop support for go 1.20
[btrtrc.git] / common / upverted_files.go
1 package common
2
3 import (
4         "github.com/anacrolix/torrent/metainfo"
5         "github.com/anacrolix/torrent/segments"
6 )
7
8 func LengthIterFromUpvertedFiles(fis []metainfo.FileInfo) segments.LengthIter {
9         i := 0
10         return func() (segments.Length, bool) {
11                 if i == len(fis) {
12                         return -1, false
13                 }
14                 l := fis[i].Length
15                 i++
16                 return l, true
17         }
18 }