Changeset 6622
- Timestamp:
- Aug 22, 2008, 2:15:37 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-mgr.c
r6621 r6622 185 185 compareAddresses( const struct in_addr * a, const struct in_addr * b ) 186 186 { 187 return tr_compareUint32( a->s_addr, b->s_addr ); 187 if (a->s_addr != b->s_addr) 188 return a->s_addr < b->s_addr ? -1 : 1; 189 190 return 0; 188 191 } 189 192 … … 565 568 if( a->priority != b->priority ) 566 569 return a->priority > b->priority ? -1 : 1; 567 570 568 571 /* otherwise if one has fewer peers, it goes first */ 569 572 if (a->peerCount != b->peerCount) … … 571 574 572 575 /* otherwise go with our random seed */ 573 return a->random - b->random; 576 if (a->random != b->random) 577 return a->random < b->random ? -1 : 1; 578 579 return 0; 574 580 } 575 581 … … 1772 1778 const struct peer_atom * b = * (const struct peer_atom**) vb; 1773 1779 1774 if( a->piece_data_time > b->piece_data_time ) return -1;1775 if( a->piece_data_time < b->piece_data_time ) return1;1780 if( a->piece_data_time != b->piece_data_time ) 1781 return a->piece_data_time < b->piece_data_time ? -1 : 1; 1776 1782 1777 1783 if( a->numFails != b->numFails )
Note: See TracChangeset
for help on using the changeset viewer.