From fc0690901465800de093f41ab2139fd68db0c735 Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Mon, 10 May 2021 17:43:10 +1000 Subject: [PATCH] Improve naming on storage key --- request-strategy.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/request-strategy.go b/request-strategy.go index 4bce3321..3c9df28f 100644 --- a/request-strategy.go +++ b/request-strategy.go @@ -96,9 +96,10 @@ func (cl *Client) doRequests() { for _, t := range cl.torrents { // TODO: We could do metainfo requests here. if t.haveInfo() { - if t.storage.Capacity != nil { - if _, ok := storageLeft[t.storage.Capacity]; !ok { - storageLeft[t.storage.Capacity] = (*t.storage.Capacity)() + key := t.storage.Capacity + if key != nil { + if _, ok := storageLeft[key]; !ok { + storageLeft[key] = (*key)() } } requestOrder.addPieces(t, t.numPieces()) -- 2.50.0