Optimize array capacity settings in style and SVG processing classes

This commit is contained in:
wuggy 2026-04-26 11:07:52 -07:00
commit cd020e380d
3 changed files with 6 additions and 2 deletions

View file

@ -530,7 +530,7 @@ nsStyleSet::GatherRuleProcessors(SheetType aType)
scope->SetIsScopedStyleRoot();
// Create a rule processor for the scope.
nsTArray<RefPtr<CSSStyleSheet>> sheetsForScope;
nsTArray<RefPtr<CSSStyleSheet>> sheetsForScope(end - start);
sheetsForScope.AppendElements(sheets.Elements() + start, end - start);
nsCSSRuleProcessor* oldRP = oldScopedRuleProcessorHash.Get(scope);
mScopedDocSheetRuleProcessors.AppendElement