From 6c69771ea5dcb88f7e64c0cd8c959b652e23ca81 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Wed, 21 Jun 2017 08:36:47 +0900 Subject: [PATCH] Use FnvHashmap instead of HashMap for AnimationValueMap. --- components/style/gecko/wrapper.rs | 2 +- .../style/properties/helpers/animated_properties.mako.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 42c9997e691..c711ee059bb 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -616,7 +616,7 @@ fn get_animation_rule(element: &GeckoElement, -> Option>> { use gecko_bindings::sugar::ownership::HasSimpleFFI; // Also, we should try to reuse the PDB, to avoid creating extra rule nodes. - let mut animation_values = AnimationValueMap::new(); + let mut animation_values = AnimationValueMap::default(); if unsafe { Gecko_GetAnimationRule(element.0, cascade_level, AnimationValueMap::as_ffi_mut(&mut animation_values)) } { diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index 8b5feb762c5..a78af95120b 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -30,7 +30,7 @@ use properties::longhands::visibility::computed_value::T as Visibility; use selectors::parser::SelectorParseError; use smallvec::SmallVec; use std::cmp; -#[cfg(feature = "gecko")] use std::collections::HashMap; +#[cfg(feature = "gecko")] use fnv::FnvHashMap; use style_traits::ParseError; use super::ComputedValues; use values::{Auto, CSSFloat, CustomIdent, Either}; @@ -440,7 +440,7 @@ impl AnimatedProperty { /// This HashMap stores the values that are the last AnimationValue to be /// composed for each TransitionProperty. #[cfg(feature = "gecko")] -pub type AnimationValueMap = HashMap; +pub type AnimationValueMap = FnvHashMap; #[cfg(feature = "gecko")] unsafe impl HasFFI for AnimationValueMap { type FFIType = RawServoAnimationValueMap;