Ignore:
Timestamp:
Nov 28, 2009, 4:25:05 PM (12 years ago)
Author:
charles
Message:

(trunk libT) remove unnecessary code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r9593 r9612  
    497497}
    498498
    499 struct RandomTracker
    500 {
    501     tr_tracker_info    tracker;
    502     int                random_value;
    503 };
    504 
    505 /* the tiers will be sorted from lowest to highest,
    506  * and trackers are randomized within the tiers */
    507 static TR_INLINE int
    508 compareRandomTracker( const void * va,
    509                       const void * vb )
    510 {
    511     const struct RandomTracker * a = va;
    512     const struct RandomTracker * b = vb;
    513 
    514     if( a->tracker.tier != b->tracker.tier )
    515         return a->tracker.tier - b->tracker.tier;
    516 
    517     return a->random_value - b->random_value;
    518 }
    519 
    520 static void
    521 randomizeTiers( tr_info * info )
    522 {
    523     int                    i;
    524     const int              n = info->trackerCount;
    525     struct RandomTracker * r = tr_new0( struct RandomTracker, n );
    526 
    527     for( i = 0; i < n; ++i )
    528     {
    529         r[i].tracker = info->trackers[i];
    530         r[i].random_value = tr_cryptoRandInt( INT_MAX );
    531     }
    532     qsort( r, n, sizeof( struct RandomTracker ), compareRandomTracker );
    533     for( i = 0; i < n; ++i )
    534         info->trackers[i] = r[i].tracker;
    535     tr_free( r );
    536 }
    537 
    538499static void torrentStart( tr_torrent * tor );
    539500
     
    641602    tor->uniqueId = nextUniqueId++;
    642603    tor->magicNumber = TORRENT_MAGIC_NUMBER;
    643 
    644     randomizeTiers( &tor->info );
    645604
    646605    tr_sha1( tor->obfuscatedHash, "req2", 4,
Note: See TracChangeset for help on using the changeset viewer.