Changeset 6965


Ignore:
Timestamp:
Oct 27, 2008, 4:27:55 AM (12 years ago)
Author:
charles
Message:

(libT) fold together some redundant sanity tests that were taking up 6.6% in softwareelves' profile

Location:
trunk/libtransmission
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-mgr.c

    r6961 r6965  
    868868        const uint32_t offset = getBlockOffsetInPiece( tor, block );
    869869        const uint32_t length = tr_torBlockCountBytes( tor, block );
    870 
    871         assert( tr_torrentReqIsValid( tor, index, offset, length ) );
    872         assert( offset < tr_torPieceCountBytes( tor, index ) );
    873         assert( (offset + length) <= tr_torPieceCountBytes( tor, index ) );
    874870
    875871        /* find a peer who can ask for this block */
  • trunk/libtransmission/torrent.c

    r6935 r6965  
    15561556    if( index >= tor->info.pieceCount )
    15571557        err = 1;
    1558     else if( offset >= tr_torPieceCountBytes( tor, index ) )
     1558    else if( ( offset + length ) >= tr_torPieceCountBytes( tor, index ) )
    15591559        err = 2;
    15601560    else if( length > MAX_BLOCK_SIZE )
    15611561        err = 3;
    1562     else if( tr_pieceOffset( tor, index, offset,
    1563                              length ) > tor->info.totalSize )
     1562    else if( tr_pieceOffset( tor, index, offset, length ) > tor->info.totalSize )
    15641563        err = 4;
    15651564
Note: See TracChangeset for help on using the changeset viewer.