From 4807d050180ab7d2d673ad8e60a980a3771ba98f Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Thu, 25 Jan 2018 17:02:52 +1100 Subject: [PATCH] Improve some comments --- connection.go | 6 +++--- piece.go | 3 +-- torrent.go | 1 + 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/connection.go b/connection.go index 794f5986..c8e28920 100644 --- a/connection.go +++ b/connection.go @@ -614,9 +614,9 @@ func (cn *connection) stopRequestingPiece(piece int) bool { } // This is distinct from Torrent piece priority, which is the user's -// preference. Connection piece priority is specific to a connection, -// pseudorandomly avoids connections always requesting the same pieces and -// thus wasting effort. +// preference. Connection piece priority is specific to a connection and is +// used to pseudorandomly avoid connections always requesting the same pieces +// and thus wasting effort. func (cn *connection) updatePiecePriority(piece int) bool { tpp := cn.t.piecePriority(piece) if !cn.PeerHasPiece(piece) { diff --git a/piece.go b/piece.go index c5d7f134..fcec8623 100644 --- a/piece.go +++ b/piece.go @@ -11,8 +11,7 @@ import ( "github.com/anacrolix/torrent/storage" ) -// Piece priority describes the importance of obtaining a particular piece. - +// Describes the importance of obtaining a particular piece. type piecePriority byte func (pp *piecePriority) Raise(maybe piecePriority) { diff --git a/torrent.go b/torrent.go index 6440a3f8..4d8ace42 100644 --- a/torrent.go +++ b/torrent.go @@ -1557,6 +1557,7 @@ func (t *Torrent) onPieceCompleted(piece int) { } } +// Called when a piece is found to be not complete. func (t *Torrent) onIncompletePiece(piece int) { if t.pieceAllDirty(piece) { t.pendAllChunkSpecs(piece) -- 2.48.1