From b2d2c524c6d5bab07376aefe669b41fcef3dee7e Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Fri, 25 Aug 2017 16:36:34 +1000 Subject: [PATCH] Fix sync.Mutex copy by value Found by go vet, per https://github.com/anacrolix/torrent/issues/179. --- connection.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/connection.go b/connection.go index d496f0c7..a893ccb8 100644 --- a/connection.go +++ b/connection.go @@ -488,7 +488,7 @@ func nextRequestState( networkingEnabled bool, currentRequests map[request]struct{}, peerChoking bool, - nextPieces prioritybitmap.PriorityBitmap, + nextPieces *prioritybitmap.PriorityBitmap, pendingChunks func(piece int, f func(chunkSpec) bool) bool, requestsLowWater int, requestsHighWater int, @@ -524,7 +524,7 @@ func (cn *connection) updateRequests() { cn.t.networkingEnabled, cn.Requests, cn.PeerChoked, - cn.pieceRequestOrder, + &cn.pieceRequestOrder, func(piece int, f func(chunkSpec) bool) bool { return undirtiedChunks(piece, cn.t, f) }, -- 2.48.1