diff --git a/components/style/selector_map.rs b/components/style/selector_map.rs index cd96aa736d8..79b3e303503 100644 --- a/components/style/selector_map.rs +++ b/components/style/selector_map.rs @@ -299,7 +299,10 @@ impl SelectorMap { // rulehash lookup may produce superfluous selectors, but the // subsequent selector matching work will filter them out. if name != lower_name { - find_push(&mut self.local_name_hash, lower_name.clone(), entry.clone()); + self.local_name_hash + .entry(lower_name.clone()) + .or_insert_with(SmallVec::new) + .push(entry.clone()); } self.local_name_hash .entry(name.clone()) @@ -485,15 +488,6 @@ fn find_bucket<'a>(mut iter: SelectorIter<'a, SelectorImpl>) -> Bucket<'a> { return current_bucket } -#[inline] -fn find_push(map: &mut PrecomputedHashMap, - key: Str, - value: V) - where VL: VecLike + Default -{ - map.entry(key).or_insert_with(VL::default).push(value) -} - /// Wrapper for PrecomputedHashMap that does ASCII-case-insensitive lookup in quirks mode. #[derive(Debug)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))]