Ignore:
Timestamp:
Apr 12, 2009, 2:52:17 PM (13 years ago)
Author:
charles
Message:

(trunk libT) more speed tweaks from valgrind

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/net.c

    r8092 r8217  
    181181tr_compareAddresses( const tr_address * a, const tr_address * b)
    182182{
    183     int addrlen;
     183    static const int sizes[2] = { sizeof(struct in_addr), sizeof(struct in6_addr) };
    184184
    185185    assert( tr_isAddress( a ) );
     
    190190        return a->type == TR_AF_INET ? 1 : -1;
    191191
    192     if( a->type == TR_AF_INET )
    193         addrlen = sizeof( struct in_addr );
    194     else
    195         addrlen = sizeof( struct in6_addr );
    196     return memcmp( &a->addr, &b->addr, addrlen );
     192    return memcmp( &a->addr, &b->addr, sizes[a->type] );
    197193}
    198194
Note: See TracChangeset for help on using the changeset viewer.