mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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
This commit is contained in:
parent
509a450cff
commit
a529c13904
1 changed files with 3 additions and 2 deletions
|
@ -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<PseudoElement> {
|
||||
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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue