1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-25 01:03:01 +00:00

(trunk libT) very minor style cleanup in tr_bandwidthAllocate()

This commit is contained in:
Charles Kerr 2009-01-02 04:46:38 +00:00
parent 461ecff904
commit 8eda177838

View file

@ -316,12 +316,12 @@ tr_bandwidthAllocate( tr_bandwidth * b,
* and/or peers that can use it */ * and/or peers that can use it */
n = peerCount; n = peerCount;
i = n ? tr_cryptoWeakRandInt( n ) : 0; /* pick a random starting point */ i = n ? tr_cryptoWeakRandInt( n ) : 0; /* pick a random starting point */
for( ; n>1 ; ) while( n > 1 )
{ {
const int increment = 1024; const int increment = 1024;
const int byteCount = tr_peerIoFlush( peers[i], dir, increment); const int bytesUsed = tr_peerIoFlush( peers[i], dir, increment);
if( byteCount == increment ) if( bytesUsed == increment )
++i; ++i;
else { else {
/* peer is done writing for now; move it to the end of the list */ /* peer is done writing for now; move it to the end of the list */
@ -331,7 +331,6 @@ tr_bandwidthAllocate( tr_bandwidth * b,
--n; --n;
} }
assert( i <= n );
if( i == n ) if( i == n )
i = 0; i = 0;
} }