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

Function left

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

Source from the content-addressed store, hash-verified

20 }
21
22 function left(a, x, lo = 0, hi = a.length) {
23 if (lo < hi) {
24 if (compare1(x, x) !== 0) return hi;
25 do {
26 const mid = (lo + hi) >>> 1;
27 if (compare2(a[mid], x) < 0) lo = mid + 1;
28 else hi = mid;
29 } while (lo < hi);
30 }
31 return lo;
32 }
33
34 function right(a, x, lo = 0, hi = a.length) {
35 if (lo < hi) {

Callers 1

centerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…