From: Charles Kerr Date: Mon, 14 Jun 2010 12:48:28 +0000 (+0000) Subject: (trunk libT) rejigger the filter order again, based on profiling in cachegrind X-Git-Tag: 2.00~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a5e708c824ab0efff95992937ab5240ce78b3278;p=transmission (trunk libT) rejigger the filter order again, based on profiling in cachegrind --- diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index ac55d410a..f9e56785e 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -3287,15 +3287,15 @@ isPeerCandidate( const tr_torrent * tor, struct peer_atom * atom, const time_t n if( atom->myflags & MYFLAG_BANNED ) return FALSE; - /* not if we just tried them already */ - if( ( now - atom->time ) < getReconnectIntervalSecs( atom, now ) ) - return FALSE; - /* not if we're both seeds */ if( tr_torrentIsSeed( tor ) ) if( atomIsSeed( atom ) || ( atom->uploadOnly == UPLOAD_ONLY_YES ) ) return FALSE; + /* not if we just tried them already */ + if( ( now - atom->time ) < getReconnectIntervalSecs( atom, now ) ) + return FALSE; + /* not if they're blocklisted */ if( isAtomBlocklisted( tor->session, atom ) ) return FALSE; @@ -3320,7 +3320,7 @@ torrentWasRecentlyStarted( const tr_torrent * tor ) return difftime( tr_time( ), tor->startDate ) < 120; } -static uint64_t +static inline uint64_t addValToKey( uint64_t value, int width, uint64_t addme ) { value = (value << (uint64_t)width);