mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
Reduce allocator churn when parsing property declaration blocks (fixes #15060)
This commit is contained in:
parent
f010fb58fd
commit
b5cb401aef
6 changed files with 81 additions and 49 deletions
|
@ -724,8 +724,6 @@ pub extern "C" fn Servo_ParseProperty(property: *const nsACString, value: *const
|
|||
_ => return RawServoDeclarationBlockStrong::null(),
|
||||
}
|
||||
|
||||
let results = results.into_iter().map(|r| (r, Importance::Normal)).collect();
|
||||
|
||||
Arc::new(RwLock::new(PropertyDeclarationBlock {
|
||||
declarations: results,
|
||||
important_count: 0,
|
||||
|
@ -863,7 +861,7 @@ fn set_property(declarations: RawServoDeclarationBlockBorrowed, property_id: Pro
|
|||
let mut declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations).write();
|
||||
let importance = if is_important { Importance::Important } else { Importance::Normal };
|
||||
for decl in decls.into_iter() {
|
||||
declarations.set_parsed_declaration(decl, importance);
|
||||
declarations.set_parsed_declaration(decl.0, importance);
|
||||
}
|
||||
true
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue