(libt) remove jump discontinuities in getMaxAtomCount

This commit is contained in:
Daniel Lee 2010-09-25 00:38:49 +00:00
parent afc7c5355e
commit 04aee3c49b
1 changed files with 4 additions and 6 deletions

View File

@ -3276,13 +3276,11 @@ compareAtomPtrsByShelfDate( const void * va, const void *vb )
static int static int
getMaxAtomCount( const tr_torrent * tor ) getMaxAtomCount( const tr_torrent * tor )
{ {
/* FIXME: this curve should be smoother... */
const int n = tor->maxConnectedPeers; const int n = tor->maxConnectedPeers;
if( n >= 200 ) return n * 1.5; /* approximate fit of the old jump discontinuous function */
if( n >= 100 ) return n * 2; if( n >= 55 ) return n + 150;
if( n >= 50 ) return n * 3; if( n >= 20 ) return 2 * n + 95;
if( n >= 20 ) return n * 5; return 4 * n + 55;
return n * 10;
} }
static void static void