src/array_list.c

changeset 885
878a450e79bd
parent 884
d375d8056262
child 888
6f44b1f1275c
equal deleted inserted replaced
884:d375d8056262 885:878a450e79bd
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));

mercurial