]> granicus.if.org Git - transmission/commitdiff
(trunk libT) #3955 "tr_torrentNext() should be inlined" -- fixed.
authorJordan Lee <jordan@transmissionbt.com>
Sat, 29 Jan 2011 18:54:43 +0000 (18:54 +0000)
committerJordan Lee <jordan@transmissionbt.com>
Sat, 29 Jan 2011 18:54:43 +0000 (18:54 +0000)
libtransmission/session.c
libtransmission/torrent.h

index 8d6813b732fff7ae10568731ba0e3e715a691583..cc3229f2ad8ce43583ae0cca92ac492c47a5a81d 100644 (file)
@@ -2348,24 +2348,6 @@ tr_sessionSetTorrentFile( tr_session * session,
         tr_bencDictAddStr( session->metainfoLookup, hashString, filename );
 }
 
-tr_torrent*
-tr_torrentNext( tr_session * session,
-                tr_torrent * tor )
-{
-    tr_torrent * ret;
-
-    assert( !session || tr_isSession( session ) );
-
-    if( !session )
-        ret = NULL;
-    else if( !tor )
-        ret = session->torrentList;
-    else
-        ret = tor->next;
-
-    return ret;
-}
-
 /***
 ****
 ***/
index 547f6defced03c2eda2f20d483e11e7b5cdb1a3b..946f1b493a49e6500a496b37451f242be8cf4b14 100644 (file)
@@ -91,9 +91,6 @@ void             tr_torrentSetPieceChecked( tr_torrent       * tor,
 
 void             tr_torrentSetChecked( tr_torrent * tor, time_t when );
 
-tr_torrent*      tr_torrentNext( tr_session  * session,
-                                 tr_torrent  * current );
-
 void             tr_torrentCheckSeedLimit( tr_torrent * tor );
 
 /** save a torrent's .resume file if it's changed since the last time it was saved */
@@ -252,6 +249,12 @@ struct tr_torrent
     tr_bool                    finishedSeedingByIdle;
 };
 
+static inline tr_torrent*
+tr_torrentNext( tr_session * session, tr_torrent * current )
+{
+    return current ? current->next : session->torrentList;
+}
+
 /* get the index of this piece's first block */
 static inline tr_block_index_t
 tr_torPieceFirstBlock( const tr_torrent * tor, const tr_piece_index_t piece )