Ignore:
Timestamp:
Oct 2, 2008, 11:37:58 PM (13 years ago)
Author:
charles
Message:

(libT) eliminating tr_errno, part 3: don't use it in tr_cpBlockBitfieldSet()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r6795 r6840  
    234234}
    235235
    236 tr_errno
     236int
    237237tr_cpBlockBitfieldSet( tr_completion * cp,
    238238                       tr_bitfield *   bitfield )
    239239{
    240     tr_block_index_t i;
     240    int success = FALSE;
    241241
    242242    assert( cp );
     
    244244    assert( cp->blockBitfield );
    245245
    246     if( !tr_bitfieldTestFast( bitfield, cp->tor->blockCount - 1 ) )
    247         return TR_ERROR_ASSERT;
    248 
    249     tr_cpReset( cp );
    250     for( i = 0; i < cp->tor->blockCount; ++i )
    251         if( tr_bitfieldHasFast( bitfield, i ) )
    252             tr_cpBlockAdd( cp, i );
    253 
    254     return 0;
     246    if( tr_bitfieldTestFast( bitfield, cp->tor->blockCount - 1 ) )
     247    {
     248        tr_block_index_t i;
     249        tr_cpReset( cp );
     250        for( i = 0; i < cp->tor->blockCount; ++i )
     251            if( tr_bitfieldHasFast( bitfield, i ) )
     252                tr_cpBlockAdd( cp, i );
     253        success = TRUE;
     254    }
     255
     256    return success;
    255257}
    256258
Note: See TracChangeset for help on using the changeset viewer.