]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Improve some comments
authorMatt Joiner <anacrolix@gmail.com>
Thu, 25 Jan 2018 06:02:52 +0000 (17:02 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 25 Jan 2018 06:02:52 +0000 (17:02 +1100)
connection.go
piece.go
torrent.go

index 794f59860ba79aa544d10fe29845a57dc46cc545..c8e2892061fc09620d993d68ce75161e5a90d93c 100644 (file)
@@ -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) {
index c5d7f134677932533a82a9d16369137d72e65f11..fcec86239a5717453be4a37f1245f6d53444ab83 100644 (file)
--- 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) {
index 6440a3f823636e4925d6465ad82c6be5a56985f7..4d8ace428cd7e7c8698e1f92cdd4a6b9ec23b166 100644 (file)
@@ -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)