From: Matt Joiner Date: Mon, 10 May 2021 07:43:10 +0000 (+1000) Subject: Improve naming on storage key X-Git-Tag: v1.29.0~31^2~43 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=fc0690901465800de093f41ab2139fd68db0c735;p=btrtrc.git Improve naming on storage key --- 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())