From: Matt Joiner Date: Sun, 11 Sep 2016 04:12:03 +0000 (+1000) Subject: Remove unused trackerTier and shuffleTier X-Git-Tag: v1.0.0~593 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=5d7882a79d5c450877f92cfddf1441deb62ac14a;p=btrtrc.git Remove unused trackerTier and shuffleTier --- diff --git a/client.go b/client.go index 4b0b1a25..d0d34ca8 100644 --- a/client.go +++ b/client.go @@ -9,7 +9,6 @@ import ( "fmt" "io" "log" - mathRand "math/rand" "net" "net/url" "strconv" @@ -1381,23 +1380,6 @@ func (cl *Client) newTorrent(ih metainfo.Hash) (t *Torrent) { return } -func init() { - // For shuffling the tracker tiers. - mathRand.Seed(time.Now().Unix()) -} - -type trackerTier []string - -// The trackers within each tier must be shuffled before use. -// http://stackoverflow.com/a/12267471/149482 -// http://www.bittorrent.org/beps/bep_0012.html#order-of-processing -func shuffleTier(tier trackerTier) { - for i := range tier { - j := mathRand.Intn(i + 1) - tier[i], tier[j] = tier[j], tier[i] - } -} - // A file-like handle to some torrent data resource. type Handle interface { io.Reader