]> Sergey Matveev's repositories - btrtrc.git/commitdiff
Improve naming on storage key
authorMatt Joiner <anacrolix@gmail.com>
Mon, 10 May 2021 07:43:10 +0000 (17:43 +1000)
committerMatt Joiner <anacrolix@gmail.com>
Mon, 7 Jun 2021 03:01:39 +0000 (13:01 +1000)
request-strategy.go

index 4bce332168ddd2c717b8061d3da9ecf055adfd79..3c9df28f064ee49774bf6239aec9f9bce238c17a 100644 (file)
@@ -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())