]> granicus.if.org Git - transmission/commitdiff
avoid unnecessary setting of id when calling tr_torrentSetAnnounceList
authorMitchell Livingston <livings124@transmissionbt.com>
Mon, 22 Feb 2010 00:15:27 +0000 (00:15 +0000)
committerMitchell Livingston <livings124@transmissionbt.com>
Mon, 22 Feb 2010 00:15:27 +0000 (00:15 +0000)
libtransmission/transmission.h
macosx/Torrent.m

index 33018c567d23da6ec00030f6e668938ea15c4647..41c55369a4f0a97174ca31bbfc172b3c8a659cb4 100644 (file)
@@ -1224,7 +1224,8 @@ tr_tracker_info;
  * @param torrent The torrent whose tracker list is to be modified
  * @param trackers An array of trackers, sorted by tier from first to last.
  *                 NOTE: only the `tier' and `announce' fields are used.
- *                 libtransmission derives `scrape' from `announce'.
+ *                 libtransmission derives `scrape' from `announce'
+ *                  and reassigns 'id'.
  * @param trackerCount size of the `trackers' array
  */
 tr_bool
index a638b72c6405bc36d8949d28271894a4a105e080..d797037d1323683fbd177d16b032b6d0d9695e0c 100644 (file)
@@ -635,10 +635,7 @@ int trashDataFile(const char * filename)
     const int oldTrackerCount = fInfo->trackerCount;
     tr_tracker_info * trackerStructs = tr_new(tr_tracker_info, oldTrackerCount+1);
     for (NSUInteger i=0; i < oldTrackerCount; ++i)
-    {
         trackerStructs[i] = fInfo->trackers[i];
-        trackerStructs[i].id = i;
-    }
     
     trackerStructs[oldTrackerCount].announce = (char *)[tracker UTF8String];
     trackerStructs[oldTrackerCount].tier = trackerStructs[oldTrackerCount-1].tier + 1;
@@ -659,10 +656,7 @@ int trashDataFile(const char * filename)
     for (NSUInteger i = 0; i < fInfo->trackerCount; i++)
     {
         if (![removeIdentifiers containsIndex: fInfo->trackers[i].id])
-        {
-            trackerStructs[newCount] = fInfo->trackers[i];
-            trackerStructs[newCount].id = newCount++;
-        }
+            trackerStructs[newCount++] = fInfo->trackers[i];
     }
     
     const BOOL success = tr_torrentSetAnnounceList(fHandle, trackerStructs, newCount);