MCPcopy Create free account
hub / github.com/alignoth/alignoth / reinit

Function reinit

resources/vega.min.js:26516–26549  ·  view source on GitHub ↗
(t, e)

Source from the content-addressed store, hash-verified

26514 return this.eval(t, e);
26515 },
26516 reinit(t, e) {
26517 const n = e.materialize().fork(),
26518 r = t.fields,
26519 i = t.query,
26520 o = this._indices,
26521 a = this._dims,
26522 s = this.value,
26523 u = s.curr(),
26524 l = s.prev(),
26525 c = s.all(),
26526 f = (n.rem = n.add),
26527 h = n.mod,
26528 d = i.length,
26529 p = {};
26530 let g, m, y, v, _, x, b, w, k;
26531 if (
26532 (l.set(u),
26533 e.rem.length && (_ = this.remove(t, e, n)),
26534 e.add.length && s.add(e.add),
26535 e.mod.length)
26536 )
26537 for (x = {}, v = e.mod, b = 0, w = v.length; b < w; ++b)
26538 x[v[b]._index] = 1;
26539 for (b = 0; b < d; ++b)
26540 ((k = r[b]),
26541 (!a[b] || t.modified("fields", b) || e.modified(k.fields)) &&
26542 ((y = k.fname),
26543 (g = p[y]) ||
26544 ((o[y] = m = FS()), (p[y] = g = m.insert(k, e.source, 0))),
26545 (a[b] = CS(m, b, i[b]).onAdd(g, u))));
26546 for (b = 0, w = s.data().length; b < w; ++b)
26547 _[b] || (l[b] !== u[b] ? f.push(b) : x[b] && u[b] !== c && h.push(b));
26548 return ((s.mask = (1 << d) - 1), n);
26549 },
26550 eval(t, e) {
26551 const n = e.materialize().fork(),
26552 r = this._dims.length;

Callers

nothing calls this directly

Calls 6

FSFunction · 0.85
CSFunction · 0.85
dataMethod · 0.80
setMethod · 0.45
removeMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected