Changeset 12006


Ignore:
Timestamp:
Feb 21, 2011, 3:36:07 PM (11 years ago)
Author:
jordan
Message:

(trunk libT) remove unused functions: tr_bitsetDifference() tr_bitfieldDifference()

Location:
trunk/libtransmission
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bitfield.c

    r12003 r12006  
    174174}
    175175
    176 /* set 'a' to all the flags that were in 'a' but not 'b' */
    177 void
    178 tr_bitfieldDifference( tr_bitfield * a, const tr_bitfield * b )
    179 {
    180     uint8_t * ait = a->bits;
    181     const uint8_t * aend = ait + a->byteCount;
    182     const uint8_t * bit = b->bits;
    183     const uint8_t * bend = bit + b->byteCount;
    184 
    185     while( ait!=aend && bit!=bend )
    186         *ait++ &= ~( *bit++ );
    187 }
    188 
    189176size_t
    190177tr_bitfieldCountTrueBits( const tr_bitfield* b )
  • trunk/libtransmission/bitfield.h

    r11709 r12006  
    5656int          tr_bitfieldRemRange( tr_bitfield*, size_t begin, size_t end );
    5757
    58 void         tr_bitfieldDifference( tr_bitfield *, const tr_bitfield * );
    59 
    6058int          tr_bitfieldIsEmpty( const tr_bitfield* );
    6159
  • trunk/libtransmission/bitset.c

    r12003 r12006  
    6161}
    6262
    63 /* set 'a' to all the flags that were in 'a' but not 'b' */
    64 void
    65 tr_bitsetDifference( tr_bitfield * a, const tr_bitset * b )
    66 {
    67     if( b->haveAll )
    68         tr_bitfieldClear( a );
    69     else if( !b->haveNone )
    70         tr_bitfieldDifference( a, &b->bitfield );
    71 }
    72 
    7363double
    7464tr_bitsetPercent( const tr_bitset * b )
  • trunk/libtransmission/bitset.h

    r12003 r12006  
    4949void tr_bitsetOr( tr_bitfield * a, const tr_bitset * b );
    5050
    51 /* set 'a' to all the flags that were in 'a' but not 'b' */
    52 void tr_bitsetDifference( tr_bitfield * a, const tr_bitset * b );
    53 
    5451#endif
  • trunk/libtransmission/peer-mgr.c

    r12003 r12006  
    31063106    /* if we're seeding and the peer has everything we have,
    31073107     * and enough time has passed for a pex exchange, then disconnect */
    3108     if( tr_torrentIsSeed( tor ) )
    3109     {
    3110         tr_bool peerHasEverything;
    3111 
    3112         if( atom->seedProbability != -1 )
    3113         {
    3114             peerHasEverything = atomIsSeed( atom );
    3115         }
    3116         else
    3117         {
    3118             tr_bitfield * tmp = tr_bitfieldDup( tr_cpPieceBitfield( &tor->completion ) );
    3119             tr_bitsetDifference( tmp, &peer->have );
    3120             peerHasEverything = tr_bitfieldCountTrueBits( tmp ) == 0;
    3121             tr_bitfieldFree( tmp );
    3122         }
    3123 
    3124         if( peerHasEverything && ( !tr_torrentAllowsPex(tor) || (now-atom->time>=30 )))
    3125         {
    3126             tordbg( t, "purging peer %s because we're both seeds",
    3127                     tr_atomAddrStr( atom ) );
    3128             return TRUE;
    3129         }
    3130     }
     3108    if( tr_torrentIsSeed( tor ) && ( peer->progress >= 1.0f ) )
     3109        return !tr_torrentAllowsPex(tor) || (now-atom->time>=30);
    31313110
    31323111    /* disconnect if it's been too long since piece data has been transferred.
Note: See TracChangeset for help on using the changeset viewer.