Fix bug in readahead

This commit is contained in:
Matt Joiner 2016-02-02 04:45:57 +11:00
parent 19a304b8ea
commit 89f23c226c
1 changed files with 2 additions and 1 deletions

View File

@ -882,10 +882,11 @@ func (t *torrent) updatePiecePriorities() {
newPrios[begin].Raise(PiecePriorityNow)
}
for i := begin + 1; i < end; i++ {
newPrios[begin].Raise(PiecePriorityReadahead)
newPrios[i].Raise(PiecePriorityReadahead)
}
return true
})
// TODO: Do I need a pass suppressing stuff that we already have?
for i, prio := range newPrios {
if prio != t.Pieces[i].priority {
t.Pieces[i].priority = prio