From 88d58502aa40068feae0ea11af8659e3f31a6644 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Thu, 13 Jan 2011 11:50:58 +0000 Subject: [PATCH] (trunk gtk) #3896 "Redundant call to tr_torrentStat() in tr_core_update()" -- fixed. --- gtk/tr-core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gtk/tr-core.c b/gtk/tr-core.c index da9a1aa9c..3a81e4f86 100644 --- a/gtk/tr-core.c +++ b/gtk/tr-core.c @@ -528,9 +528,8 @@ torrentTrackerString( tr_torrent * tor ) } static gboolean -isTorrentActive( tr_torrent * tor ) +isTorrentActive( const tr_stat * st ) { - const tr_stat * st = tr_torrentStat( tor ); return ( st->peersSendingToUs > 0 ) || ( st->peersGettingFromUs > 0 ) || ( st->activity == TR_STATUS_CHECK ); @@ -885,7 +884,7 @@ tr_core_add_torrent( TrCore * self, MC_TORRENT_RAW, tor, MC_SPEED_UP, st->pieceUploadSpeed_KBps, MC_SPEED_DOWN, st->pieceDownloadSpeed_KBps, - MC_ACTIVE, isTorrentActive( tor ), + MC_ACTIVE, isTorrentActive( st ), MC_ACTIVITY, st->activity, MC_FINISHED, st->finished, MC_PRIORITY, tr_torrentGetPriority( tor ), @@ -1306,7 +1305,7 @@ update_foreach( GtkTreeModel * model, /* get the new states */ tor = tr_torrent_handle( gtor ); st = tr_torrentStat( tor ); - newActive = isTorrentActive( tor ); + newActive = isTorrentActive( st ); newActivity = st->activity; newFinished = st->finished; newPriority = tr_torrentGetPriority( tor );