mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 20:16:02 +00:00
LibWeb: Avoid two calls to Selector::specificity() when sorting rules
This commit is contained in:
parent
22465e80fe
commit
963aa213c5
Notes:
sideshowbarker
2024-07-16 23:44:30 +09:00
Author: https://github.com/awesomekling
Commit: 963aa213c5
Pull-request: https://github.com/SerenityOS/serenity/pull/23634
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 1 additions and 1 deletions
|
@ -371,7 +371,7 @@ static void sort_matching_rules(Vector<MatchingRule>& matching_rules)
|
||||||
auto const& b_selector = b.rule->selectors()[b.selector_index];
|
auto const& b_selector = b.rule->selectors()[b.selector_index];
|
||||||
auto a_specificity = a_selector->specificity();
|
auto a_specificity = a_selector->specificity();
|
||||||
auto b_specificity = b_selector->specificity();
|
auto b_specificity = b_selector->specificity();
|
||||||
if (a_selector->specificity() == b_selector->specificity()) {
|
if (a_specificity == b_specificity) {
|
||||||
if (a.style_sheet_index == b.style_sheet_index)
|
if (a.style_sheet_index == b.style_sheet_index)
|
||||||
return a.rule_index < b.rule_index;
|
return a.rule_index < b.rule_index;
|
||||||
return a.style_sheet_index < b.style_sheet_index;
|
return a.style_sheet_index < b.style_sheet_index;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue