Changeset 6102 for trunk/libtransmission/completion.c
- Timestamp:
- Jun 9, 2008, 11:05:14 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/completion.c
r6092 r6102 305 305 tr_cpGetAmountDone( const tr_completion * cp, float * tab, int tabCount ) 306 306 { 307 int i; 308 const int isComplete = tr_cpGetStatus ( cp ) == TR_CP_COMPLETE; 307 309 const int tabSpan = cp->tor->blockCount / tabCount; 308 310 tr_block_index_t block_i = 0; 309 int tab_i; 310 for( tab_i=0; tab_i<tabCount; ++tab_i ) { 311 int loop, have; 312 for( loop=have=0; loop<tabSpan; ++loop ) 313 if( tr_cpBlockIsComplete( cp, block_i++ ) ) 314 ++have; 315 tab[tab_i] = (float)have / tabSpan; 311 for( i=0; i<tabCount; ++i ) { 312 if( isComplete ) 313 tab[i] = 1.0f; 314 else { 315 int loop, have; 316 for( loop=have=0; loop<tabSpan; ++loop ) 317 if( tr_cpBlockIsComplete( cp, block_i++ ) ) 318 ++have; 319 tab[i] = (float)have / tabSpan; 320 } 316 321 } 317 322 }
Note: See TracChangeset
for help on using the changeset viewer.