]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Add comments on File.{first,end}PieceIndex
authorMatt Joiner <anacrolix@gmail.com>
Tue, 26 Nov 2019 05:22:41 +0000 (16:22 +1100)
committerMatt Joiner <anacrolix@gmail.com>
Thu, 28 Nov 2019 01:51:25 +0000 (12:51 +1100)
file.go

diff --git a/file.go b/file.go
index 6925101c637f79b9587ce3add782bbcb6641e6d8..5c6d8ebea27e6cb5ff8b0f4d4fcbf0731a204ea4 100644 (file)
--- a/file.go
+++ b/file.go
@@ -169,6 +169,7 @@ func (f *File) Priority() piecePriority {
        return f.prio
 }
 
+// Returns the index of the first piece containing data for the file.
 func (f *File) firstPieceIndex() pieceIndex {
        if f.t.usualPieceSize() == 0 {
                return 0
@@ -176,6 +177,7 @@ func (f *File) firstPieceIndex() pieceIndex {
        return pieceIndex(f.offset / int64(f.t.usualPieceSize()))
 }
 
+// Returns the index of the piece after the last one containing data for the file.
 func (f *File) endPieceIndex() pieceIndex {
        if f.t.usualPieceSize() == 0 {
                return 0