mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Remove now-redundant Arc inside PropertyDeclarationBlock.
This commit is contained in:
parent
acc38aa8c2
commit
ad3437b98a
6 changed files with 23 additions and 26 deletions
|
@ -286,7 +286,7 @@ impl Importance {
|
|||
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
|
||||
pub struct PropertyDeclarationBlock {
|
||||
#[cfg_attr(feature = "servo", ignore_heap_size_of = "#7038")]
|
||||
pub declarations: Arc<Vec<(PropertyDeclaration, Importance)>>,
|
||||
pub declarations: Vec<(PropertyDeclaration, Importance)>,
|
||||
|
||||
/// The number of entries in `self.declaration` with `Importance::Important`
|
||||
pub important_count: u32,
|
||||
|
@ -567,7 +567,7 @@ pub fn parse_property_declaration_list(context: &ParserContext, input: &mut Pars
|
|||
}
|
||||
}
|
||||
let mut block = PropertyDeclarationBlock {
|
||||
declarations: Arc::new(declarations),
|
||||
declarations: declarations,
|
||||
important_count: important_count,
|
||||
};
|
||||
deduplicate_property_declarations(&mut block);
|
||||
|
@ -583,8 +583,7 @@ fn deduplicate_property_declarations(block: &mut PropertyDeclarationBlock) {
|
|||
let mut seen_custom_normal = Vec::new();
|
||||
let mut seen_custom_important = Vec::new();
|
||||
|
||||
let declarations = Arc::get_mut(&mut block.declarations).unwrap();
|
||||
for (declaration, importance) in declarations.drain(..).rev() {
|
||||
for (declaration, importance) in block.declarations.drain(..).rev() {
|
||||
match declaration {
|
||||
% for property in data.longhands:
|
||||
PropertyDeclaration::${property.camel_case}(..) => {
|
||||
|
@ -636,7 +635,7 @@ fn deduplicate_property_declarations(block: &mut PropertyDeclarationBlock) {
|
|||
deduplicated.push((declaration, importance))
|
||||
}
|
||||
deduplicated.reverse();
|
||||
*declarations = deduplicated;
|
||||
block.declarations = deduplicated;
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue