]> Sergey Matveev's repositories - btrtrc.git/blobdiff - torrent_test.go
Drop bradfitz/iter dependency (#605)
[btrtrc.git] / torrent_test.go
index 053ed5d1a444b8b8d9c9461e865ed5ca03343b73..bd762c9c009bc04c38b752b381fb9178540428c0 100644 (file)
@@ -10,7 +10,6 @@ import (
 
        "github.com/anacrolix/missinggo/v2"
        "github.com/anacrolix/missinggo/v2/bitmap"
-       "github.com/bradfitz/iter"
        "github.com/stretchr/testify/assert"
        "github.com/stretchr/testify/require"
 
@@ -91,7 +90,7 @@ func BenchmarkUpdatePiecePriorities(b *testing.B) {
                Length:      pieceLength * numPieces,
        }))
        assert.EqualValues(b, 13410, t.numPieces())
-       for range iter.N(7) {
+       for i := 0; i < 7; i += 1 {
                r := t.NewReader()
                r.SetReadahead(32 << 20)
                r.Seek(3500000, io.SeekStart)
@@ -101,7 +100,7 @@ func BenchmarkUpdatePiecePriorities(b *testing.B) {
                t._completedPieces.Add(bitmap.BitIndex(i))
        }
        t.DownloadPieces(0, t.numPieces())
-       for range iter.N(b.N) {
+       for i := 0; i < b.N; i += 1 {
                t.updateAllPiecePriorities()
        }
 }