Skip to content

Commit

Permalink
Remove buffering from results channel
Browse files Browse the repository at this point in the history
  • Loading branch information
veggiedefender committed Jan 4, 2020
1 parent 09818df commit 2768f3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (t *Torrent) Download() ([]byte, error) {
log.Println("Starting download for", t.Name)
// Init queues for workers to retrieve work and send results
workQueue := make(chan *pieceWork, len(t.PieceHashes))
results := make(chan *pieceResult, len(t.PieceHashes))
results := make(chan *pieceResult)
for index, hash := range t.PieceHashes {
length := t.calculatePieceSize(index)
workQueue <- &pieceWork{index, hash, length}
Expand Down

0 comments on commit 2768f3e

Please sign in to comment.