From d26b93cff46fa6e88a3f713cf597f18e0c22a5e0 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 26 Nov 2019 16:22:41 +1100 Subject: [PATCH] Add comments on File.{first,end}PieceIndex --- file.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/file.go b/file.go index 6925101c..5c6d8ebe 100644 --- 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