mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01: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:
parent
a5100e3c78
commit
aa15dc269f
270 changed files with 580 additions and 514 deletions
|
@ -36,7 +36,7 @@ impl TaskSource for DOMManipulationTaskSource {
|
|||
{
|
||||
let msg = MainThreadScriptMsg::Common(CommonScriptMsg::Task(
|
||||
ScriptThreadEventCategory::ScriptEvent,
|
||||
box canceller.wrap_task(task),
|
||||
Box::new(canceller.wrap_task(task)),
|
||||
));
|
||||
self.0.send(msg).map_err(|_| ())
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ impl TaskSource for FileReadingTaskSource {
|
|||
{
|
||||
self.0.send(CommonScriptMsg::Task(
|
||||
ScriptThreadEventCategory::FileRead,
|
||||
box canceller.wrap_task(task),
|
||||
Box::new(canceller.wrap_task(task)),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,6 @@ impl ScriptChan for HistoryTraversalTaskSource {
|
|||
}
|
||||
|
||||
fn clone(&self) -> Box<ScriptChan + Send> {
|
||||
box HistoryTraversalTaskSource((&self.0).clone())
|
||||
Box::new(HistoryTraversalTaskSource((&self.0).clone()))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ impl TaskSource for NetworkingTaskSource {
|
|||
{
|
||||
self.0.send(CommonScriptMsg::Task(
|
||||
ScriptThreadEventCategory::NetworkEvent,
|
||||
box canceller.wrap_task(task),
|
||||
Box::new(canceller.wrap_task(task)),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ impl NetworkingTaskSource {
|
|||
{
|
||||
self.0.send(CommonScriptMsg::Task(
|
||||
ScriptThreadEventCategory::NetworkEvent,
|
||||
box task,
|
||||
Box::new(task),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ impl TaskSource for PerformanceTimelineTaskSource {
|
|||
{
|
||||
let msg = CommonScriptMsg::Task(
|
||||
ScriptThreadEventCategory::PerformanceTimelineTask,
|
||||
box canceller.wrap_task(task)
|
||||
Box::new(canceller.wrap_task(task))
|
||||
);
|
||||
self.0.send(msg).map_err(|_| ())
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ impl TaskSource for UserInteractionTaskSource {
|
|||
{
|
||||
let msg = MainThreadScriptMsg::Common(CommonScriptMsg::Task(
|
||||
ScriptThreadEventCategory::InputEvent,
|
||||
box canceller.wrap_task(task),
|
||||
Box::new(canceller.wrap_task(task)),
|
||||
));
|
||||
self.0.send(msg).map_err(|_| ())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue