MCPcopy Create free account
hub / github.com/microsoft/SandDance / setWindow

Function setWindow

docs/app/js/sanddance-app.js:119045–119051  ·  view source on GitHub ↗
(w, f, i, n)

Source from the content-addressed store, hash-verified

119043 }
119044}
119045function setWindow(w, f, i, n) {
119046 w.p0 = w.i0;
119047 w.p1 = w.i1;
119048 w.i0 = f[0] == null ? 0 : Math.max(0, i - Math.abs(f[0]));
119049 w.i1 = f[1] == null ? n : Math.min(n, i + Math.abs(f[1]) + 1);
119050 w.index = i;
119051} // if frame type is 'range', adjust window for peer values
119052function adjustRange(w, bisect) {
119053 const r0 = w.i0, r1 = w.i1 - 1, c = w.compare, d = w.data, n = d.length - 1;
119054 if (r0 > 0 && !c(d[r0], d[r0 - 1])) w.i0 = bisect.left(d, d[r0]);

Callers 1

processPartitionFunction · 0.70

Calls 2

maxMethod · 0.45
minMethod · 0.45

Tested by

no test coverage detected