| 893 | |
| 894 | |
| 895 | static unsigned int binsearch (const TValue *array, unsigned int i, |
| 896 | unsigned int j) { |
| 897 | while (j - i > 1u) { /* binary search */ |
| 898 | unsigned int m = (i + j) / 2; |
| 899 | if (isempty(&array[m - 1])) j = m; |
| 900 | else i = m; |
| 901 | } |
| 902 | return i; |
| 903 | } |
| 904 | |
| 905 | |
| 906 | /* |