| 867 | |
| 868 | |
| 869 | static unsigned int binsearch (const TValue *array, unsigned int i, |
| 870 | unsigned int j) { |
| 871 | while (j - i > 1u) { /* binary search */ |
| 872 | unsigned int m = (i + j) / 2; |
| 873 | if (isempty(&array[m - 1])) j = m; |
| 874 | else i = m; |
| 875 | } |
| 876 | return i; |
| 877 | } |
| 878 | |
| 879 | |
| 880 | /* |