From: Matt Joiner Date: Fri, 25 Aug 2017 06:36:34 +0000 (+1000) Subject: Fix sync.Mutex copy by value X-Git-Tag: v1.0.0~437 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=b2d2c524c6d5bab07376aefe669b41fcef3dee7e;p=btrtrc.git Fix sync.Mutex copy by value Found by go vet, per https://github.com/anacrolix/torrent/issues/179. --- 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) },