249 // cast the array pointer to something we can use offsets with |
249 // cast the array pointer to something we can use offsets with |
250 char const *array = arr; |
250 char const *array = arr; |
251 |
251 |
252 // check the first array element |
252 // check the first array element |
253 result = cmp_func(elem, array); |
253 result = cmp_func(elem, array); |
254 if (result <= 0) { |
254 if (result < 0) { |
|
255 return size; |
|
256 } else if (result == 0) { |
255 return 0; |
257 return 0; |
256 } |
258 } |
257 |
259 |
258 // check the last array element |
260 // check the last array element |
259 result = cmp_func(elem, array + elem_size * (size - 1)); |
261 result = cmp_func(elem, array + elem_size * (size - 1)); |