From: Matt Joiner Date: Sun, 28 Nov 2021 13:44:24 +0000 (+1100) Subject: Optimize Torrent.haveAnyPieces X-Git-Tag: v1.39.0~38 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=4f3db19ca36cb264b9e2bd729a30f64c4cc585f3;p=btrtrc.git Optimize Torrent.haveAnyPieces --- diff --git a/torrent.go b/torrent.go index 79a3ecb6..d047be4e 100644 --- a/torrent.go +++ b/torrent.go @@ -908,7 +908,7 @@ func (t *Torrent) hashPiece(piece pieceIndex) (ret metainfo.Hash, err error) { } func (t *Torrent) haveAnyPieces() bool { - return t._completedPieces.GetCardinality() != 0 + return !t._completedPieces.IsEmpty() } func (t *Torrent) haveAllPieces() bool {