From: Matt Joiner Date: Thu, 29 Oct 2015 14:16:52 +0000 (+1100) Subject: Avoid copying mutex in piece X-Git-Tag: v1.0.0~1000 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=f8fb4808177416745b65d174b43126dba4d422e5;p=btrtrc.git Avoid copying mutex in piece --- diff --git a/client.go b/client.go index 0385b4fa..fea00be6 100644 --- a/client.go +++ b/client.go @@ -1781,7 +1781,8 @@ func (t *torrent) needData() bool { if len(t.urgent) != 0 { return true } - for _, p := range t.Pieces { + for i := range t.Pieces { + p := &t.Pieces[i] if p.Priority != PiecePriorityNone { return true }