Ignore:
Timestamp:
May 16, 2011, 7:11:21 AM (11 years ago)
Author:
jordan
Message:

(trunk libT) better r12434

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/torrent.c

    r12434 r12435  
    870870
    871871    /* add the torrent to tr_session.torrentList */
    872     {
    873         tr_torrent * it = NULL;
    874         tr_torrent * last = NULL;
    875         while(( it = tr_torrentNext( session, it )))
    876             last = it;
    877 
    878         if( !last )
    879             session->torrentList = tor;
    880         else
    881             last->next = tor;
    882         ++session->torrentCount;
     872    ++session->torrentCount;
     873    if( session->torrentList == NULL )
     874        session->torrentList = tor;
     875    else {
     876        tr_torrent * it = session->torrentList;
     877        while( it->next != NULL )
     878            it = it->next;
     879        it->next = tor;
    883880    }
    884881
Note: See TracChangeset for help on using the changeset viewer.