about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-08-17 22:59:46 -0700
committerBrian Anderson <banderson@mozilla.com>2013-08-24 15:46:04 -0700
commit44c88ddf4237ca18d7eb7b437f46731da7f30bb5 (patch)
tree774075a59534439249496574b1c962f8cb1d1eab /src/libstd
parent8fc1d9db21fa9d4abd9b40d09be8fa061abb3bb5 (diff)
downloadrust-44c88ddf4237ca18d7eb7b437f46731da7f30bb5.tar.gz
rust-44c88ddf4237ca18d7eb7b437f46731da7f30bb5.zip
std::rt: Remove an unnecessary allocation from the main sched loop
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/rt/task.rs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs
index 12ba39a6dcd..9c2a6e646d2 100644
--- a/src/libstd/rt/task.rs
+++ b/src/libstd/rt/task.rs
@@ -59,7 +59,7 @@ pub struct Task {
 }
 
 pub enum TaskType {
-    GreenTask(Option<~SchedHome>),
+    GreenTask(Option<SchedHome>),
     SchedTask
 }
 
@@ -173,7 +173,7 @@ impl Task {
             name: None,
             coroutine: Some(Coroutine::new(stack_pool, stack_size, start)),
             sched: None,
-            task_type: GreenTask(Some(~home)),
+            task_type: GreenTask(Some(home)),
             borrow_list: None
         }
     }
@@ -196,7 +196,7 @@ impl Task {
             name: None,
             coroutine: Some(Coroutine::new(stack_pool, stack_size, start)),
             sched: None,
-            task_type: GreenTask(Some(~home)),
+            task_type: GreenTask(Some(home)),
             borrow_list: None
         }
     }
@@ -204,7 +204,7 @@ impl Task {
     pub fn give_home(&mut self, new_home: SchedHome) {
         match self.task_type {
             GreenTask(ref mut home) => {
-                *home = Some(~new_home);
+                *home = Some(new_home);
             }
             SchedTask => {
                 rtabort!("type error: used SchedTask as GreenTask");
@@ -216,7 +216,7 @@ impl Task {
         match self.task_type {
             GreenTask(ref mut home) => {
                 let out = home.take_unwrap();
-                return *out;
+                return out;
             }
             SchedTask => {
                 rtabort!("type error: used SchedTask as GreenTask");
@@ -275,8 +275,8 @@ impl Task {
 
     pub fn is_home_no_tls(&self, sched: &~Scheduler) -> bool {
         match self.task_type {
-            GreenTask(Some(~AnySched)) => { false }
-            GreenTask(Some(~Sched(SchedHandle { sched_id: ref id, _}))) => {
+            GreenTask(Some(AnySched)) => { false }
+            GreenTask(Some(Sched(SchedHandle { sched_id: ref id, _}))) => {
                 *id == sched.sched_id()
             }
             GreenTask(None) => {
@@ -291,8 +291,8 @@ impl Task {
 
     pub fn homed(&self) -> bool {
         match self.task_type {
-            GreenTask(Some(~AnySched)) => { false }
-            GreenTask(Some(~Sched(SchedHandle { _ }))) => { true }
+            GreenTask(Some(AnySched)) => { false }
+            GreenTask(Some(Sched(SchedHandle { _ }))) => { true }
             GreenTask(None) => {
                 rtabort!("task without home");
             }
@@ -309,11 +309,11 @@ impl Task {
             let sched_id = task.sched.get_ref().sched_id();
             let sched_run_anything = task.sched.get_ref().run_anything;
             match task.task_type {
-                GreenTask(Some(~AnySched)) => {
+                GreenTask(Some(AnySched)) => {
                     rtdebug!("anysched task in sched check ****");
                     sched_run_anything
                 }
-                GreenTask(Some(~Sched(SchedHandle { sched_id: ref id, _ }))) => {
+                GreenTask(Some(Sched(SchedHandle { sched_id: ref id, _ }))) => {
                     rtdebug!("homed task in sched check ****");
                     *id == sched_id
                 }