mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-25 20:22:18 +03: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: https://github.com/SerenityOS/serenity/commit/963aa213c5 Pull-request: https://github.com/SerenityOS/serenity/pull/23634 Reviewed-by: https://github.com/AtkinsSJ ✅
@ -371,7 +371,7 @@ static void sort_matching_rules(Vector<MatchingRule>& matching_rules)
|
||||
auto const& b_selector = b.rule->selectors()[b.selector_index];
|
||||
auto a_specificity = a_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)
|
||||
return a.rule_index < b.rule_index;
|
||||
return a.style_sheet_index < b.style_sheet_index;
|
||||
|
Loading…
Reference in New Issue
Block a user