]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Tidy up
authorMatt Joiner <anacrolix@gmail.com>
Wed, 6 Mar 2024 11:50:03 +0000 (22:50 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Wed, 6 Mar 2024 11:50:03 +0000 (22:50 +1100)
internal/cmd/issue-908/main.go
peer_protocol/decoder.go
segments/index.go
segments/segments_test.go
storage/file-misc_test.go
storage/file-piece.go
torrent.go

index a25447bae890adde647f9c76fb71a3b03bd0ca2c..96da2e8ebf2a0c7a3a5b9cdd17416a4e7a0ea3f4 100644 (file)
@@ -2,11 +2,12 @@ package main
 
 import (
        "fmt"
-       "github.com/davecgh/go-spew/spew"
        "log"
        "net/http"
        "os"
 
+       "github.com/davecgh/go-spew/spew"
+
        "github.com/anacrolix/torrent"
        "github.com/anacrolix/torrent/bencode"
        "github.com/anacrolix/torrent/metainfo"
index 49eda4369959275889ce99a7c06681e6c103556d..06d991e689cd72b7faff79eb685f7689b61441d1 100644 (file)
@@ -4,10 +4,10 @@ import (
        "bufio"
        "encoding/binary"
        "fmt"
-       g "github.com/anacrolix/generics"
        "io"
        "sync"
 
+       g "github.com/anacrolix/generics"
        "github.com/pkg/errors"
 )
 
index d7ae744b1259bcd3a69cb7deee71efff58b611df..7ed308059b361ece47112763c2416d4b21d8f93d 100644 (file)
@@ -1,8 +1,9 @@
 package segments
 
 import (
-       g "github.com/anacrolix/generics"
        "sort"
+
+       g "github.com/anacrolix/generics"
 )
 
 func NewIndex(segments LengthIter) (ret Index) {
index e757654f9daea9b5995b0571b9ff9e3be5ec33a9..ef165714f245b0fd609d3318be8adfa717e0de72 100644 (file)
@@ -1,8 +1,9 @@
 package segments
 
 import (
-       qt "github.com/frankban/quicktest"
        "testing"
+
+       qt "github.com/frankban/quicktest"
 )
 
 func LengthIterFromSlice(ls []Length) LengthIter {
index 9e97ce00ec49c5a109b0dfb645bb010fc91a038a..706fc2103ba4ee0da4e64656dedf748ee38bc7f9 100644 (file)
@@ -1,14 +1,14 @@
 package storage
 
 import (
-       "github.com/anacrolix/torrent/common"
-       "github.com/anacrolix/torrent/segments"
-       qt "github.com/frankban/quicktest"
        "testing"
 
+       qt "github.com/frankban/quicktest"
        "github.com/stretchr/testify/assert"
 
+       "github.com/anacrolix/torrent/common"
        "github.com/anacrolix/torrent/metainfo"
+       "github.com/anacrolix/torrent/segments"
 )
 
 type requiredLength struct {
index 99ff5fc8675129083f4fd1b4d8dbe6fc0bfc7168..98fb806b8d3ae8ff5317a4accc401ae55075d240 100644 (file)
@@ -1,12 +1,12 @@
 package storage
 
 import (
-       "github.com/anacrolix/torrent/segments"
        "io"
        "log"
        "os"
 
        "github.com/anacrolix/torrent/metainfo"
+       "github.com/anacrolix/torrent/segments"
 )
 
 type filePieceImpl struct {
index b63b09fa2726045bb04c3e69dfac02864dd076ab..525159773a7a62d50a39917775316b7deb7bec0d 100644 (file)
@@ -744,7 +744,7 @@ func (t *Torrent) pieceStateRuns() (ret PieceStateRuns) {
                })
        })
        for index := range t.pieces {
-               rle.Append(t.pieceState(pieceIndex(index)), 1)
+               rle.Append(t.pieceState(index), 1)
        }
        rle.Flush()
        return