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:
Emilio Cobos Álvarez 2018-01-10 03:46:54 +01:00
parent bfc91c5e12
commit 8f6455b9df
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
5 changed files with 37 additions and 40 deletions

View file

@ -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(