Optimize the garbage collector to produce smaller files

This commit is contained in:
be5invis 2023-08-25 03:11:15 -07:00
parent a3836f8144
commit 80700d9dc8
8 changed files with 322 additions and 70 deletions

View file

@ -41,17 +41,6 @@ function regulateCompositeGlyph(glyphStore, memo, g) {
if (!gn) return memoSet(memo, g, false);
}
// De-doppelganger
while (refs.length === 1 && regulateCompositeGlyph(glyphStore, memo, refs[0].glyph)) {
const sr = refs[0];
const targetRefs = sr.glyph.geometry.asReferences();
g.clearGeometry();
for (const tr of targetRefs) {
g.includeGeometry(new Geom.ReferenceGeometry(tr.glyph, tr.x + sr.x, tr.y + sr.y));
}
refs = g.geometry.asReferences();
}
return memoSet(memo, g, true);
}