From a529c139049d27100dc4c30d9816c546fcad2d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Wed, 31 May 2017 17:15:54 +0200 Subject: [PATCH] Bug 1369187: style: Use ArrayVec for the pseudo-elements we need to restyle. r=bholley Just a drive-by, easy optimization. MozReview-Commit-ID: AVaeWvBHLzc --- components/style/data.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/style/data.rs b/components/style/data.rs index 2cf5bd56eb1..5d56ace2441 100644 --- a/components/style/data.rs +++ b/components/style/data.rs @@ -4,6 +4,7 @@ //! Per-node data used in style calculation. +use arrayvec::ArrayVec; use context::SharedStyleContext; use dom::TElement; use properties::{AnimationRules, ComputedValues, PropertyDeclarationBlock}; @@ -193,8 +194,8 @@ impl EagerPseudoStyles { } /// Returns a list of the pseudo-elements. - pub fn keys(&self) -> Vec { - let mut v = Vec::new(); + pub fn keys(&self) -> ArrayVec<[PseudoElement; EAGER_PSEUDO_COUNT]> { + let mut v = ArrayVec::new(); if let Some(ref arr) = self.0 { for i in 0..EAGER_PSEUDO_COUNT { if arr[i].is_some() {