Torrent.unpendPieces: Only update unpended pieces

Updating all pieces at once is no longer faster. (There was an optimization for this a while ago that no longer exists.)
This commit is contained in:
Matt Joiner 2016-10-31 19:05:08 +11:00
parent a8e96ce996
commit df60a765a7
1 changed files with 4 additions and 1 deletions

View File

@ -982,7 +982,10 @@ func (t *Torrent) getCompletedPieces() (ret bitmap.Bitmap) {
func (t *Torrent) unpendPieces(unpend *bitmap.Bitmap) {
t.pendingPieces.Sub(unpend)
t.updatePiecePriorities()
unpend.IterTyped(func(piece int) (again bool) {
t.updatePiecePriority(piece)
return true
})
}
func (t *Torrent) pendPieceRange(begin, end int) {