MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / dedupePairsLocal

Function dedupePairsLocal

test/compute-engine/diophantine.test.ts:379–390  ·  view source on GitHub ↗
(pairs: [bigint, bigint][])

Source from the content-addressed store, hash-verified

377}
378
379function dedupePairsLocal(pairs: [bigint, bigint][]): [bigint, bigint][] {
380 const seen = new Set<string>();
381 const out: [bigint, bigint][] = [];
382 for (const p of pairs) {
383 const k = pairKey(p);
384 if (!seen.has(k)) {
385 seen.add(k);
386 out.push(p);
387 }
388 }
389 return out;
390}
391
392function pairSetEqual(a: [bigint, bigint][], b: [bigint, bigint][]): boolean {
393 const as = new Set(dedupePairsLocal(a).map(pairKey));

Callers 2

pairSetEqualFunction · 0.85
pellFamilyMembersInBoxFunction · 0.85

Calls 3

pairKeyFunction · 0.85
hasMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected