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

Function FS

resources/vega.min.js:26342–26414  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26340 };
26341 }
26342 function FS() {
26343 let t = ES(0),
26344 e = [],
26345 n = 0;
26346 return {
26347 insert: function (r, i, o) {
26348 if (!i.length) return [];
26349 const a = n,
26350 s = i.length,
26351 u = ES(s);
26352 let l,
26353 c,
26354 f,
26355 h = Array(s);
26356 for (f = 0; f < s; ++f) ((h[f] = r(i[f])), (u[f] = f));
26357 if (
26358 ((h = (function (t, e) {
26359 return (
26360 t.sort.call(e, (e, n) => {
26361 const r = t[e],
26362 i = t[n];
26363 return r < i ? -1 : r > i ? 1 : 0;
26364 }),
26365 (function (t, e) {
26366 return Array.from(e, (e) => t[e]);
26367 })(t, e)
26368 );
26369 })(h, u)),
26370 a)
26371 )
26372 ((l = e),
26373 (c = t),
26374 (e = Array(a + s)),
26375 (t = ES(a + s)),
26376 (function (t, e, n, r, i, o, a, s, u) {
26377 let l,
26378 c = 0,
26379 f = 0;
26380 for (l = 0; c < r && f < a; ++l)
26381 e[c] < i[f]
26382 ? ((s[l] = e[c]), (u[l] = n[c++]))
26383 : ((s[l] = i[f]), (u[l] = o[f++] + t));
26384 for (; c < r; ++c, ++l) ((s[l] = e[c]), (u[l] = n[c]));
26385 for (; f < a; ++f, ++l) ((s[l] = i[f]), (u[l] = o[f] + t));
26386 })(o, l, c, a, h, u, s, e, t));
26387 else {
26388 if (o > 0) for (f = 0; f < s; ++f) u[f] += o;
26389 ((e = h), (t = u));
26390 }
26391 return ((n = a + s), { index: u, value: h });
26392 },
26393 remove: function (r, i) {
26394 const o = n;
26395 let a, s, u;
26396 for (s = 0; !i[t[s]] && s < o; ++s);
26397 for (u = s; s < o; ++s)
26398 i[(a = t[s])] || ((t[u] = a), (e[u] = e[s]), ++u);
26399 n = o - r;

Callers 2

initFunction · 0.85
reinitFunction · 0.85

Calls 3

ESFunction · 0.85
rFunction · 0.70
fromMethod · 0.45

Tested by

no test coverage detected