(a, x, lo = 0, hi = a.length)
| 32 | } |
| 33 | |
| 34 | function right(a, x, lo = 0, hi = a.length) { |
| 35 | if (lo < hi) { |
| 36 | if (compare1(x, x) !== 0) return hi; |
| 37 | do { |
| 38 | const mid = (lo + hi) >>> 1; |
| 39 | if (compare2(a[mid], x) <= 0) lo = mid + 1; |
| 40 | else hi = mid; |
| 41 | } while (lo < hi); |
| 42 | } |
| 43 | return lo; |
| 44 | } |
| 45 | |
| 46 | function center(a, x, lo = 0, hi = a.length) { |
| 47 | const i = left(a, x, lo, hi - 1); |
nothing calls this directly
no outgoing calls
no test coverage detected