style: Remove hashes from style rules and dependencies.

Dependencies are very numerous, and now we shouldn't be getting so many of them.

Style rules just don't need them, so it's a waste of memory.
This commit is contained in:
Emilio Cobos Álvarez 2017-07-13 03:57:44 +02:00
parent 9394ea9644
commit dee4aea264
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
8 changed files with 61 additions and 84 deletions

View file

@ -164,10 +164,10 @@ pub fn matches_selector_list<E>(selector_list: &SelectorList<E::Impl>,
-> bool
where E: Element
{
selector_list.0.iter().any(|selector_and_hashes| {
matches_selector(&selector_and_hashes.selector,
selector_list.0.iter().any(|selector| {
matches_selector(selector,
0,
&selector_and_hashes.hashes,
None,
element,
context,
&mut |_, _| {})
@ -371,7 +371,7 @@ enum SelectorMatchingResult {
#[inline(always)]
pub fn matches_selector<E, F>(selector: &Selector<E::Impl>,
offset: usize,
hashes: &AncestorHashes,
hashes: Option<&AncestorHashes>,
element: &E,
context: &mut MatchingContext,
flags_setter: &mut F)
@ -380,9 +380,11 @@ pub fn matches_selector<E, F>(selector: &Selector<E::Impl>,
F: FnMut(&E, ElementSelectorFlags),
{
// Use the bloom filter to fast-reject.
if let Some(filter) = context.bloom_filter {
if !may_match::<E>(hashes, filter) {
return false;
if let Some(hashes) = hashes {
if let Some(filter) = context.bloom_filter {
if !may_match::<E>(hashes, filter) {
return false;
}
}
}