MCPcopy Create free account
hub / github.com/d3/d3-array / right

Function right

src/bisector.js:34–44  ·  view source on GitHub ↗
(a, x, lo = 0, hi = a.length)

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected