mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +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
|
@ -47,18 +47,9 @@ impl PrecomputedHash for Namespace {
|
|||
}
|
||||
|
||||
/// A Gecko WeakNamespace is a wrapped WeakAtom.
|
||||
#[derive(Hash)]
|
||||
#[derive(Hash, Deref)]
|
||||
pub struct WeakNamespace(WeakAtom);
|
||||
|
||||
impl Deref for WeakNamespace {
|
||||
type Target = WeakAtom;
|
||||
|
||||
#[inline]
|
||||
fn deref(&self) -> &WeakAtom {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for Namespace {
|
||||
type Target = WeakNamespace;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue