Use SmallBitVec to replace BitVec

This commit is contained in:
Matt Brubeck 2017-09-08 21:11:23 -07:00
parent 4721ef81fd
commit 21006fb752
5 changed files with 17 additions and 11 deletions

View file

@ -6,7 +6,6 @@
use {Atom, LocalName, Namespace};
use applicable_declarations::{ApplicableDeclarationBlock, ApplicableDeclarationList};
use bit_vec::BitVec;
use context::{CascadeInputs, QuirksMode};
use dom::TElement;
use element_state::ElementState;
@ -34,6 +33,7 @@ use selectors::sink::Push;
use selectors::visitor::SelectorVisitor;
use servo_arc::{Arc, ArcBorrow};
use shared_lock::{Locked, SharedRwLockReadGuard, StylesheetGuards};
use smallbitvec::SmallBitVec;
use smallvec::VecLike;
use std::fmt::Debug;
use std::ops;
@ -1493,7 +1493,7 @@ impl Stylist {
element: &E,
bloom: Option<&BloomFilter>,
flags_setter: &mut F
) -> BitVec
) -> SmallBitVec
where
E: TElement,
F: FnMut(&E, ElementSelectorFlags),
@ -1508,7 +1508,7 @@ impl Stylist {
// This means we're guaranteed to get the same rulehash buckets for all
// the lookups, which means that the bitvecs are comparable. We verify
// this in the caller by asserting that the bitvecs are same-length.
let mut results = BitVec::new();
let mut results = SmallBitVec::new();
for (data, _) in self.cascade_data.iter_origins() {
data.selectors_for_cache_revalidation.lookup(
*element,