| 647 | |
| 648 | |
| 649 | protected int indexHunt(int c, int start, int stop) { |
| 650 | int pivot = (start + stop) / 2; |
| 651 | |
| 652 | // if this is the char, then return it |
| 653 | if (c == glyphs[pivot].value) return pivot; |
| 654 | |
| 655 | // char doesn't exist, otherwise would have been the pivot |
| 656 | //if (start == stop) return -1; |
| 657 | if (start >= stop) return -1; |
| 658 | |
| 659 | // if it's in the lower half, continue searching that |
| 660 | if (c < glyphs[pivot].value) return indexHunt(c, start, pivot-1); |
| 661 | |
| 662 | // if it's in the upper half, continue there |
| 663 | return indexHunt(c, pivot+1, stop); |
| 664 | } |
| 665 | |
| 666 | |
| 667 | /** |