mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
LibWeb: Use unchecked_append in StyleComputer::collect_matching_rules()
We already grow the "rules to run" vector before appending to it, so we can actually use unchecked_append() here and avoid the "needs to grow" checks every time we append to it. This takes appending from 3% to <1% when loading our GitHub repo.
This commit is contained in:
parent
b15316eba8
commit
a378303629
1 changed files with 2 additions and 2 deletions
|
@ -315,12 +315,12 @@ Vector<MatchingRule> StyleComputer::collect_matching_rules(DOM::Element const& e
|
|||
if (pseudo_element.has_value()) {
|
||||
for (auto const& rule : rules) {
|
||||
if (rule.contains_pseudo_element && filter_namespace_rule(element, rule))
|
||||
rules_to_run.append(rule);
|
||||
rules_to_run.unchecked_append(rule);
|
||||
}
|
||||
} else {
|
||||
for (auto const& rule : rules) {
|
||||
if (filter_namespace_rule(element, rule))
|
||||
rules_to_run.append(rule);
|
||||
rules_to_run.unchecked_append(rule);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue