Changeset 7606 for trunk/libtransmission/peer-msgs.c
- Timestamp:
- Jan 4, 2009, 2:49:30 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libtransmission/peer-msgs.c
r7588 r7606 123 123 }; 124 124 125 static int 126 compareRequest( const void * va, const void * vb ) 127 { 128 const struct peer_request * a = va; 129 const struct peer_request * b = vb; 130 131 if( a->index != b->index ) 132 return a->index < b->index ? -1 : 1; 133 134 if( a->offset != b->offset ) 135 return a->offset < b->offset ? -1 : 1; 136 137 if( a->length != b->length ) 138 return a->length < b->length ? -1 : 1; 139 140 return 0; 125 static inline tr_bool 126 requestsMatch( const struct peer_request * a, const struct peer_request * b ) 127 { 128 return (a->index==b->index) && (a->offset==b->offset) && (a->length==b->length); 141 129 } 142 130 … … 222 210 223 211 for( i = 0; i < list->count; ++i ) 224 if( !compareRequest( key, list->requests + i ) )212 if( requestsMatch( key, list->requests + i ) ) 225 213 return i; 226 214
Note: See TracChangeset
for help on using the changeset viewer.