mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00: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
Notes:
sideshowbarker
2024-07-17 03:05:16 +09:00
Author: https://github.com/awesomekling
Commit: a378303629
Pull-request: https://github.com/SerenityOS/serenity/pull/23602
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
Add a link
Reference in a new issue