mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Use SmallVec in GetStyleRuleList.
This commit is contained in:
parent
c6f4ced45c
commit
0212c5d230
1 changed files with 3 additions and 2 deletions
|
@ -2046,13 +2046,14 @@ pub extern "C" fn Servo_ComputedValues_EqualCustomProperties(
|
|||
#[no_mangle]
|
||||
pub extern "C" fn Servo_ComputedValues_GetStyleRuleList(values: ServoStyleContextBorrowed,
|
||||
rules: RawGeckoServoStyleRuleListBorrowedMut) {
|
||||
use smallvec::SmallVec;
|
||||
|
||||
let rule_node = match values.rules {
|
||||
Some(ref r) => r,
|
||||
None => return,
|
||||
};
|
||||
|
||||
// TODO(emilio): Will benefit from SmallVec.
|
||||
let mut result = vec![];
|
||||
let mut result = SmallVec::<[_; 10]>::new();
|
||||
for node in rule_node.self_and_ancestors() {
|
||||
let style_rule = match *node.style_source() {
|
||||
StyleSource::Style(ref rule) => rule,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue