mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
style: Avoid some allocations in selector serialization.
The allocations in display_to_css_identifier show up in the profiles of bug 1675628. Differential Revision: https://phabricator.services.mozilla.com/D97856
This commit is contained in:
parent
4ea378a6ae
commit
9f40b9ba38
19 changed files with 220 additions and 114 deletions
|
@ -1651,7 +1651,7 @@ impl<'a> SelectorVisitor for StylistSelectorVisitor<'a> {
|
|||
//
|
||||
// NOTE(emilio): See the comment regarding on when this may
|
||||
// break in visit_complex_selector.
|
||||
self.mapped_ids.insert(id.clone());
|
||||
self.mapped_ids.insert(id.0.clone());
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
|
@ -2078,7 +2078,7 @@ impl CascadeData {
|
|||
self.part_rules
|
||||
.get_or_insert_with(|| Box::new(Default::default()))
|
||||
.for_insertion(pseudo_element)
|
||||
.try_entry(parts.last().unwrap().clone())?
|
||||
.try_entry(parts.last().unwrap().clone().0)?
|
||||
.or_insert_with(SmallVec::new)
|
||||
.try_push(rule)?;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue