style: Use PrecomputedHasher for custom properties.

This commit is contained in:
Emilio Cobos Álvarez 2017-09-29 22:32:42 +02:00
parent 497897ffc9
commit b7b22b76a8
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 69 additions and 61 deletions

View file

@ -693,8 +693,7 @@ impl PropertyDeclarationBlock {
inherited_custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>,
) -> Option<Arc<::custom_properties::CustomPropertiesMap>> {
let mut custom_properties = None;
// FIXME: Use PrecomputedHasher instead.
let mut seen_custom = HashSet::new();
let mut seen_custom = PrecomputedHashSet::default();
for declaration in self.normal_declaration_iter() {
if let PropertyDeclaration::Custom(ref name, ref value) = *declaration {

View file

@ -15,7 +15,6 @@ use app_units::Au;
use servo_arc::{Arc, UniqueArc};
use smallbitvec::SmallBitVec;
use std::borrow::Cow;
use hash::HashSet;
use std::{fmt, mem, ops};
use std::cell::RefCell;
#[cfg(feature = "gecko")] use std::ptr;
@ -35,6 +34,7 @@ use media_queries::Device;
use parser::ParserContext;
#[cfg(feature = "gecko")] use properties::longhands::system_font::SystemFont;
use rule_cache::{RuleCache, RuleCacheConditions};
use selector_map::PrecomputedHashSet;
use selector_parser::PseudoElement;
use selectors::parser::SelectorParseError;
#[cfg(feature = "servo")] use servo_config::prefs::PREFS;
@ -3272,7 +3272,7 @@ where
let inherited_custom_properties = inherited_style.custom_properties();
let mut custom_properties = None;
let mut seen_custom = HashSet::new();
let mut seen_custom = PrecomputedHashSet::default();
for (declaration, _cascade_level) in iter_declarations() {
if let PropertyDeclaration::Custom(ref name, ref value) = *declaration {
::custom_properties::cascade(