diff options
Diffstat (limited to 'src/test/bench/task-perf-one-million.rs')
| -rw-r--r-- | src/test/bench/task-perf-one-million.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/bench/task-perf-one-million.rs b/src/test/bench/task-perf-one-million.rs index 9e04ad65eb2..cdbec1784b9 100644 --- a/src/test/bench/task-perf-one-million.rs +++ b/src/test/bench/task-perf-one-million.rs @@ -19,13 +19,13 @@ use std::vec; fn calc(children: uint, parent_wait_chan: &Chan<Chan<Chan<int>>>) { - let wait_ports: ~[Port<Chan<Chan<int>>>] = do vec::from_fn(children) |_| { + let wait_ports: ~[Port<Chan<Chan<int>>>] = vec::from_fn(children, |_| { let (wait_port, wait_chan) = stream::<Chan<Chan<int>>>(); do task::spawn { calc(children / 2, &wait_chan); } wait_port - }; + }); let child_start_chans: ~[Chan<Chan<int>>] = wait_ports.move_iter().map(|port| port.recv()).collect(); @@ -35,11 +35,11 @@ fn calc(children: uint, parent_wait_chan: &Chan<Chan<Chan<int>>>) { let parent_result_chan: Chan<int> = start_port.recv(); let child_sum_ports: ~[Port<int>] = - do child_start_chans.move_iter().map |child_start_chan| { + child_start_chans.move_iter().map(|child_start_chan| { let (child_sum_port, child_sum_chan) = stream::<int>(); child_start_chan.send(child_sum_chan); child_sum_port - }.collect(); + }).collect(); let sum = child_sum_ports.move_iter().fold(0, |sum, sum_port| sum + sum_port.recv() ); |
