Changeset 9463 for trunk/libtransmission/utils.c
 Timestamp:
 Oct 31, 2009, 10:16:06 PM (12 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/libtransmission/utils.c
r9444 r9463 1109 1109 size_t first = 0; 1110 1110 const char * cbase = base; 1111 tr_bool exact = FALSE; 1112 int c; 1111 1113 1112 1114 while( nmemb ) … … 1114 1116 const size_t half = nmemb / 2; 1115 1117 const size_t middle = first + half; 1116 const int c = compar( key, cbase + size*middle ); 1117 1118 if( c < 0 ) 1119 { 1118 c = compar( key, cbase + size*middle ); 1119 1120 if( c <= 0 ) { 1121 if( c == 0 ) 1122 exact = TRUE; 1123 nmemb = half; 1124 } else { 1120 1125 first = middle + 1; 1121 1126 nmemb = nmemb  half  1; 1122 1127 } 1123 else if( !c )1124 {1125 if( exact_match )1126 *exact_match = TRUE;1127 return middle;1128 }1129 else1130 {1131 nmemb = half;1132 }1133 1128 } 1134 1129 1135 1130 if( exact_match ) 1136 *exact_match = FALSE;1131 *exact_match = exact; 1137 1132 1138 1133 return first;
Note: See TracChangeset
for help on using the changeset viewer.