mirror of
https://github.com/servo/servo
synced 2026-04-26 01:25:32 +02:00
Remove use of unstable box syntax.
http://www.robohornet.org gives a score of 101.36 on master, and 102.68 with this PR. The latter is slightly better, but probably within noise level. So it looks like this PR does not affect DOM performance. This is expected since `Box::new` is defined as: ```rust impl<T> Box<T> { #[inline(always)] pub fn new(x: T) -> Box<T> { box x } } ``` With inlining, it should compile to the same as box syntax.
This commit is contained in:
@@ -64,18 +64,21 @@ impl XMLDocument {
|
||||
doc_loader: DocumentLoader)
|
||||
-> DomRoot<XMLDocument> {
|
||||
let doc = reflect_dom_object(
|
||||
box XMLDocument::new_inherited(window,
|
||||
has_browsing_context,
|
||||
url,
|
||||
origin,
|
||||
doctype,
|
||||
content_type,
|
||||
last_modified,
|
||||
activity,
|
||||
source,
|
||||
doc_loader),
|
||||
Box::new(XMLDocument::new_inherited(
|
||||
window,
|
||||
has_browsing_context,
|
||||
url,
|
||||
origin,
|
||||
doctype,
|
||||
content_type,
|
||||
last_modified,
|
||||
activity,
|
||||
source,
|
||||
doc_loader
|
||||
)),
|
||||
window,
|
||||
XMLDocumentBinding::Wrap);
|
||||
XMLDocumentBinding::Wrap
|
||||
);
|
||||
{
|
||||
let node = doc.upcast::<Node>();
|
||||
node.set_owner_doc(&doc.document);
|
||||
|
||||
Reference in New Issue
Block a user