aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-07-06 03:49:06 +0200
committerDimitri Sokolyuk <demon@dim13.org>2016-07-06 03:49:06 +0200
commit05296aa99672db4ab512995356602fde5ac58b4f (patch)
tree35d8d3018b93693f7be02f6ce50744641730ed05
parent50fba5e62484b0feec50b571f76edca45a607a38 (diff)
minor update
-rw-r--r--meta/info.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/meta/info.go b/meta/info.go
index 8f76c72..03a9a21 100644
--- a/meta/info.go
+++ b/meta/info.go
@@ -21,15 +21,14 @@ type Info struct {
RootHash []byte `bencode:"root hash"` // BEP-0030
}
-func (i Info) TotalLength() int {
+func (i Info) TotalLength() (l int) {
if i.Length > 0 {
return i.Length
}
- var l int
for _, f := range i.Files {
l += f.Length
}
- return l
+ return
}
func (i Info) GetPieces() []Piece {