mirror of
https://github.com/transmission/transmission
synced 2025-03-09 05:14:09 +00:00
(trunk libT) more speed tweaks from valgrind
This commit is contained in:
parent
e46700022b
commit
a2b53f5cbd
2 changed files with 4 additions and 8 deletions
|
@ -180,7 +180,7 @@ tr_pton( const char * src, tr_address * dst )
|
|||
int
|
||||
tr_compareAddresses( const tr_address * a, const tr_address * b)
|
||||
{
|
||||
int addrlen;
|
||||
static const int sizes[2] = { sizeof(struct in_addr), sizeof(struct in6_addr) };
|
||||
|
||||
assert( tr_isAddress( a ) );
|
||||
assert( tr_isAddress( b ) );
|
||||
|
@ -189,11 +189,7 @@ tr_compareAddresses( const tr_address * a, const tr_address * b)
|
|||
if( a->type != b->type )
|
||||
return a->type == TR_AF_INET ? 1 : -1;
|
||||
|
||||
if( a->type == TR_AF_INET )
|
||||
addrlen = sizeof( struct in_addr );
|
||||
else
|
||||
addrlen = sizeof( struct in6_addr );
|
||||
return memcmp( &a->addr, &b->addr, addrlen );
|
||||
return memcmp( &a->addr, &b->addr, sizes[a->type] );
|
||||
}
|
||||
|
||||
tr_bool
|
||||
|
|
|
@ -743,8 +743,8 @@ tr_peerIoReadBytes( tr_peerIo * io,
|
|||
break;
|
||||
|
||||
case PEER_ENCRYPTION_RC4:
|
||||
evbuffer_remove( inbuf, bytes, byteCount );
|
||||
tr_cryptoDecrypt( io->crypto, byteCount, bytes, bytes );
|
||||
tr_cryptoDecrypt( io->crypto, byteCount, EVBUFFER_DATA(inbuf), bytes );
|
||||
evbuffer_drain(inbuf, byteCount );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Add table
Reference in a new issue