mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Remove some unneeded indirection.
All TElement's implement Copy, and are just pointers, so the double indirection is stupid. I'm going to try to see if removing this double-indirection fixes some selector-matching performance, and this is a trivial pre-requisite while I wait for Talos results.
This commit is contained in:
parent
bfc91c5e12
commit
8f6455b9df
5 changed files with 37 additions and 40 deletions
|
@ -155,8 +155,8 @@ impl SelectorMap<Rule> {
|
|||
/// Sort the Rules at the end to maintain cascading order.
|
||||
pub fn get_all_matching_rules<E, F>(
|
||||
&self,
|
||||
element: &E,
|
||||
rule_hash_target: &E,
|
||||
element: E,
|
||||
rule_hash_target: E,
|
||||
matching_rules_list: &mut ApplicableDeclarationList,
|
||||
context: &mut MatchingContext<E::Impl>,
|
||||
quirks_mode: QuirksMode,
|
||||
|
@ -217,7 +217,7 @@ impl SelectorMap<Rule> {
|
|||
|
||||
/// Adds rules in `rules` that match `element` to the `matching_rules` list.
|
||||
fn get_matching_rules<E, F>(
|
||||
element: &E,
|
||||
element: E,
|
||||
rules: &[Rule],
|
||||
matching_rules: &mut ApplicableDeclarationList,
|
||||
context: &mut MatchingContext<E::Impl>,
|
||||
|
@ -232,7 +232,7 @@ impl SelectorMap<Rule> {
|
|||
if matches_selector(&rule.selector,
|
||||
0,
|
||||
Some(&rule.hashes),
|
||||
element,
|
||||
&element,
|
||||
context,
|
||||
flags_setter) {
|
||||
matching_rules.push(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue