style: Use fnv hashing for pseudo-elements

This commit is contained in:
Emilio Cobos Álvarez 2016-02-11 03:05:06 +01:00
parent dd503dfacb
commit eddec5cc06
3 changed files with 10 additions and 8 deletions

View file

@ -5,6 +5,7 @@
use properties::ComputedValues;
use selectors::parser::SelectorImpl;
use std::collections::HashMap;
use std::hash::BuildHasherDefault;
use std::sync::Arc;
use std::sync::atomic::AtomicIsize;
@ -13,7 +14,7 @@ pub struct PrivateStyleData<Impl: SelectorImpl> {
pub style: Option<Arc<ComputedValues>>,
/// The results of CSS styling for each pseudo-element (if any).
pub per_pseudo: HashMap<Impl::PseudoElement, Option<Arc<ComputedValues>>>,
pub per_pseudo: HashMap<Impl::PseudoElement, Option<Arc<ComputedValues>>, BuildHasherDefault<::fnv::FnvHasher>>,
/// Information needed during parallel traversals.
pub parallel: DomParallelInfo,
@ -23,7 +24,7 @@ impl<Impl: SelectorImpl> PrivateStyleData<Impl> {
pub fn new() -> PrivateStyleData<Impl> {
PrivateStyleData {
style: None,
per_pseudo: HashMap::new(),
per_pseudo: HashMap::with_hasher(Default::default()),
parallel: DomParallelInfo::new(),
}
}