mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1240921 - Use nsAutoTArray in nsStyleSet::RuleNodeWithReplacement. r=bz.
It's hot in some workloads and so this avoids some heap churn.
This commit is contained in:
parent
d3433dfe83
commit
466173ba37
@ -1521,7 +1521,9 @@ nsStyleSet::RuleNodeWithReplacement(Element* aElement,
|
||||
// rule tree from ElementRestyler::RestyleSelf to avoid taking that
|
||||
// path when we're rebuilding the rule tree.
|
||||
|
||||
nsTArray<RuleNodeInfo> rules;
|
||||
// This array can be hot and often grows to ~20 elements, so inline storage
|
||||
// is best.
|
||||
nsAutoTArray<RuleNodeInfo, 30> rules;
|
||||
for (nsRuleNode* ruleNode = aOldRuleNode; !ruleNode->IsRoot();
|
||||
ruleNode = ruleNode->GetParent()) {
|
||||
RuleNodeInfo* curRule = rules.AppendElement();
|
||||
|
Loading…
Reference in New Issue
Block a user