Bug 1929360 - Reserve capacity before bulk append in CreateObserversForAnimatedGlyphs r=layout-reviewers,emilio

Differential Revision: https://phabricator.services.mozilla.com/D228084
This commit is contained in:
Emily McDonough
2024-11-07 23:14:23 +00:00
parent 3e6a59c3b1
commit 3ada87c36c

View File

@@ -939,6 +939,8 @@ static void CreateObserversForAnimatedGlyphs(gfxTextRun* aTextRun) {
aTextRun->SetFlagBits(nsTextFrameUtils::Flags::MightHaveGlyphChanges);
observers->SetCapacity(observers->Length() +
fontsWithAnimatedGlyphs.Length());
for (auto font : fontsWithAnimatedGlyphs) {
observers->AppendElement(MakeUnique<GlyphObserver>(font, aTextRun));
}