aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 {