Optimize the garbage collector to produce smaller files
This commit is contained in:
parent
a3836f8144
commit
80700d9dc8
8 changed files with 322 additions and 70 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue