Fix request heap pop bug
Missed in the changed interface from 613470861e
. Caused very poor performance. Thanks to @AskAlexSharov for raising the flag in https://github.com/anacrolix/torrent/issues/859#issuecomment-1706059960.
This commit is contained in:
parent
72c1152b39
commit
87f6cdc1e9
|
@ -265,7 +265,7 @@ func (p *Peer) applyRequestState(next desiredRequestState) {
|
|||
originalRequestCount, p.needRequestUpdate))
|
||||
}
|
||||
for requestHeap.Len() != 0 && maxRequests(current.Requests.GetCardinality()+current.Cancelled.GetCardinality()) < p.nominalMaxRequests() {
|
||||
req := requestHeap.Pop()
|
||||
req := heap.Pop(requestHeap)
|
||||
existing := t.requestingPeer(req)
|
||||
if existing != nil && existing != p {
|
||||
// Don't steal from the poor.
|
||||
|
|
Loading…
Reference in New Issue