mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Optimise local name cloning in Document::CreateAttribute
This commit is contained in:
parent
25ae4ed093
commit
f7fb035188
1 changed files with 1 additions and 3 deletions
|
@ -1932,11 +1932,9 @@ impl DocumentMethods for Document {
|
||||||
local_name.make_ascii_lowercase();
|
local_name.make_ascii_lowercase();
|
||||||
}
|
}
|
||||||
let name = Atom::from(&*local_name);
|
let name = Atom::from(&*local_name);
|
||||||
// repetition used because string_cache::atom::Atom is non-copyable
|
|
||||||
let l_name = Atom::from(&*local_name);
|
|
||||||
let value = AttrValue::String(DOMString::new());
|
let value = AttrValue::String(DOMString::new());
|
||||||
|
|
||||||
Ok(Attr::new(&self.window, name, value, l_name, ns!(), None, None))
|
Ok(Attr::new(&self.window, name.clone(), value, name, ns!(), None, None))
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#dom-document-createattributens
|
// https://dom.spec.whatwg.org/#dom-document-createattributens
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue