From f8fb4808177416745b65d174b43126dba4d422e5 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 30 Oct 2015 01:16:52 +1100 Subject: [PATCH] Avoid copying mutex in piece --- client.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 }