Optimize Torrent.haveAnyPieces

This commit is contained in:
Matt Joiner 2021-11-29 00:44:24 +11:00
parent 97e1e2469b
commit 4f3db19ca3
1 changed files with 1 additions and 1 deletions

View File

@ -908,7 +908,7 @@ func (t *Torrent) hashPiece(piece pieceIndex) (ret metainfo.Hash, err error) {
} }
func (t *Torrent) haveAnyPieces() bool { func (t *Torrent) haveAnyPieces() bool {
return t._completedPieces.GetCardinality() != 0 return !t._completedPieces.IsEmpty()
} }
func (t *Torrent) haveAllPieces() bool { func (t *Torrent) haveAllPieces() bool {