mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +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.
|
//! Per-node data used in style calculation.
|
||||||
|
|
||||||
|
use arrayvec::ArrayVec;
|
||||||
use context::SharedStyleContext;
|
use context::SharedStyleContext;
|
||||||
use dom::TElement;
|
use dom::TElement;
|
||||||
use properties::{AnimationRules, ComputedValues, PropertyDeclarationBlock};
|
use properties::{AnimationRules, ComputedValues, PropertyDeclarationBlock};
|
||||||
|
@ -193,8 +194,8 @@ impl EagerPseudoStyles {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns a list of the pseudo-elements.
|
/// Returns a list of the pseudo-elements.
|
||||||
pub fn keys(&self) -> Vec<PseudoElement> {
|
pub fn keys(&self) -> ArrayVec<[PseudoElement; EAGER_PSEUDO_COUNT]> {
|
||||||
let mut v = Vec::new();
|
let mut v = ArrayVec::new();
|
||||||
if let Some(ref arr) = self.0 {
|
if let Some(ref arr) = self.0 {
|
||||||
for i in 0..EAGER_PSEUDO_COUNT {
|
for i in 0..EAGER_PSEUDO_COUNT {
|
||||||
if arr[i].is_some() {
|
if arr[i].is_some() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue