| 820 | |
| 821 | |
| 822 | static unsigned int binsearch (const TValue *array, unsigned int i, |
| 823 | unsigned int j) { |
| 824 | while (j - i > 1u) { /* binary search */ |
| 825 | unsigned int m = (i + j) / 2; |
| 826 | if (isempty(&array[m - 1])) j = m; |
| 827 | else i = m; |
| 828 | } |
| 829 | return i; |
| 830 | } |
| 831 | |
| 832 | |
| 833 | /* |