diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-10-16 11:21:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-16 11:21:21 -0500 |
commit | a9022be0c3e30249845ca5947ac0c0a6743c7991 (patch) | |
tree | 00ce691d18ebd214fa85e811955db511d69ffec2 /components/script/dom/xmldocument.rs | |
parent | 5e3c4c21986b10ac7292d75245e57700f5075b1a (diff) | |
parent | aa15dc269f41503d81ad44cd7e85d69e6f4aeac7 (diff) | |
download | servo-a9022be0c3e30249845ca5947ac0c0a6743c7991.tar.gz servo-a9022be0c3e30249845ca5947ac0c0a6743c7991.zip |
Auto merge of #18900 - servo:box_syntax, r=emilio
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.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18900)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/xmldocument.rs')
-rw-r--r-- | components/script/dom/xmldocument.rs | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/components/script/dom/xmldocument.rs b/components/script/dom/xmldocument.rs index f5ef640abce..a74cb88af6b 100644 --- a/components/script/dom/xmldocument.rs +++ b/components/script/dom/xmldocument.rs @@ -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); |