From: Matt Joiner Date: Thu, 25 Jan 2018 06:02:52 +0000 (+1100) Subject: Improve some comments X-Git-Tag: v1.0.0~267 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=4807d050180ab7d2d673ad8e60a980a3771ba98f;p=btrtrc.git Improve some comments --- 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)