Use the bloom filter for child selectors.

This speeds up bloom-basic-ref.html by 4x on my machine.
This commit is contained in:
Bobby Holley 2017-04-14 21:17:06 +08:00
parent f537fbd08f
commit f13ed246fd

View file

@ -122,6 +122,7 @@ fn may_match<E>(mut selector: &ComplexSelector<E::Impl>,
loop { loop {
match selector.next { match selector.next {
None => break, None => break,
Some((ref cs, Combinator::Child)) |
Some((ref cs, Combinator::Descendant)) => selector = &**cs, Some((ref cs, Combinator::Descendant)) => selector = &**cs,
Some((ref cs, _)) => { Some((ref cs, _)) => {
selector = &**cs; selector = &**cs;