Ignore:
Timestamp:
Sep 20, 2011, 11:39:40 PM (10 years ago)
Author:
jordan
Message:

#4496 'freeze when having a huge torrent' -- add a bitfield helper function to init the bitfield from an array of flags.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r12531 r12902  
    256256    else if( !tr_cpHasNone( cp ) ) {
    257257        tr_piece_index_t i;
     258        bool * flags = tr_new( bool, n );
    258259        for( i=0; i<n; ++i )
    259             if( tr_cpPieceIsComplete( cp, i ) )
    260                 tr_bitfieldAdd( &pieces, i );
     260            flags[i] = tr_cpPieceIsComplete( cp, i );
     261        tr_bitfieldSetFromFlags( &pieces, flags, n );
     262        tr_free( flags );
    261263    }
    262264
Note: See TracChangeset for help on using the changeset viewer.