Changeset 13141


Ignore:
Timestamp:
Jan 8, 2012, 4:11:07 AM (10 years ago)
Author:
livings124
Message:

store the list of newly-adding transfers in a set rather than an array

Location:
trunk/macosx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/Controller.h

    r13140 r13141  
    104104    NSMutableDictionary             * fPendingTorrentDownloads;
    105105   
    106     NSMutableArray                  * fAddingTransfers;
     106    NSMutableSet                    * fAddingTransfers;
    107107   
    108108    BOOL                            fGlobalPopoverShown;
  • trunk/macosx/Controller.m

    r13140 r13141  
    888888           
    889889            if (!fAddingTransfers)
    890                 fAddingTransfers = [[NSMutableArray alloc] init];
     890                fAddingTransfers = [[NSMutableSet alloc] init];
    891891            [fAddingTransfers addObject: torrent];
    892892        }
     
    910910       
    911911        if (!fAddingTransfers)
    912             fAddingTransfers = [[NSMutableArray alloc] init];
     912            fAddingTransfers = [[NSMutableSet alloc] init];
    913913        [fAddingTransfers addObject: torrent];
    914914       
     
    968968       
    969969        if (!fAddingTransfers)
    970             fAddingTransfers = [[NSMutableArray alloc] init];
     970            fAddingTransfers = [[NSMutableSet alloc] init];
    971971        [fAddingTransfers addObject: torrent];
    972972    }
     
    989989       
    990990        if (!fAddingTransfers)
    991             fAddingTransfers = [[NSMutableArray alloc] init];
     991            fAddingTransfers = [[NSMutableSet alloc] init];
    992992        [fAddingTransfers addObject: torrent];
    993993       
     
    16871687    CGFloat dlRate = 0.0, ulRate = 0.0;
    16881688    BOOL completed = NO;
    1689     #warning use a block to do in parallel?
    16901689    for (Torrent * torrent in fTorrents)
    16911690    {
     
    21782177            }];
    21792178           
    2180             if (index == NSNotFound){
    2181                 [(Torrent *)objDisplay setPreviousFinishedPieces: nil];}
     2179            if (index == NSNotFound)
     2180                [(Torrent *)objDisplay setPreviousFinishedPieces: nil];
    21822181            else
    21832182                [unusedIndexesInAll removeIndex: index];
     
    45624561   
    45634562    if (!fAddingTransfers)
    4564         fAddingTransfers = [[NSMutableArray alloc] init];
     4563        fAddingTransfers = [[NSMutableSet alloc] init];
    45654564    [fAddingTransfers addObject: torrent];
    45664565   
Note: See TracChangeset for help on using the changeset viewer.