mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +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
|
@ -216,13 +216,13 @@ where
|
|||
// TODO(emilio): Do this more efficiently!
|
||||
snapshot.each_class(|c| {
|
||||
if !element.has_class(c, CaseSensitivity::CaseSensitive) {
|
||||
classes_removed.push(c.clone())
|
||||
classes_removed.push(c.0.clone())
|
||||
}
|
||||
});
|
||||
|
||||
element.each_class(|c| {
|
||||
if !snapshot.has_class(c, CaseSensitivity::CaseSensitive) {
|
||||
classes_added.push(c.clone())
|
||||
classes_added.push(c.0.clone())
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue