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

Method chop

src/compute-engine/index.ts:836–863  ·  view source on GitHub ↗
(n: number | BigDecimal | Complex)

Source from the content-addressed store, hash-verified

834 (before !== undefined &&
835 after !== undefined &&
836 (before.size !== after.size ||
837 [...after].some((n) => !before.has(n))))
838 )
839 changed = true;
840 if (after === undefined) delete arities._forwardArity;
841 else arities._forwardArity = after;
842 // Sum-sugar bookkeeping (A6): declaration metadata, restored with the
843 // rest of the record so a rolled-back pre-pass declaration cannot
844 // leave a stale `sumOf`/variant list behind for the compile tier.
845 if (r._sumOf !== s.sumOf) changed = true;
846 if (s.sumOf === undefined) delete r._sumOf;
847 else r._sumOf = s.sumOf;
848 if (r._sumVariants !== s.sumVariants) changed = true;
849 if (s.sumVariants === undefined) delete r._sumVariants;
850 else r._sumVariants = s.sumVariants;
851 // The redefinition stamp (see the snapshot above). Deliberately NOT
852 // counted as a `changed` field: it selects nothing a boxed expression
853 // could have read, so restoring it alone must not cold every
854 // mutation-keyed cache — the same reasoning that makes the whole
855 // bump conditional. (The P47 `_implOrigin` restore below is silent for
856 // the same reason.)
857 if (s.declOrigin === undefined) delete r._declOrigin;
858 else r._declOrigin = s.declOrigin;
859 if (r._minted !== s.minted) changed = true;
860 if (s.minted === undefined) delete r._minted;
861 else r._minted = s.minted;
862 // A record that vanished from the table but is still captured by a
863 // pre-pass-built type keeps its restored fields — same contract as a
864 // statement replacement rollback.
865 if (!(r.name in registry)) {
866 registry[r.name] = r;

Callers

nothing calls this directly

Calls 6

absMethod · 0.65
isZeroMethod · 0.65
isPositiveMethod · 0.45
lteMethod · 0.45
isNegativeMethod · 0.45
gteMethod · 0.45

Tested by

no test coverage detected