From 377eabd7b49a8bb2278886f2683a435bd0eaae86 Mon Sep 17 00:00:00 2001
From: Matt Joiner <anacrolix@gmail.com>
Date: Sat, 11 Sep 2021 21:17:31 +1000
Subject: [PATCH] Pre-allocate request strategy pieces

---
 requesting.go | 1 +
 1 file changed, 1 insertion(+)

diff --git a/requesting.go b/requesting.go
index 16da8393..6a10e0a9 100644
--- a/requesting.go
+++ b/requesting.go
@@ -46,6 +46,7 @@ func (cl *Client) doRequests() {
 		if t.storage != nil {
 			rst.Capacity = t.storage.Capacity
 		}
+		rst.Pieces = make([]request_strategy.Piece, 0, len(t.pieces))
 		for i := range t.pieces {
 			p := &t.pieces[i]
 			rst.Pieces = append(rst.Pieces, request_strategy.Piece{
-- 
2.51.0