De-mode vec::each() and many of the str iteration routines
Note that the method foo.each() is not de-moded, nor the other vec routines.
This commit is contained in:
parent
62b7f4d800
commit
9cf271fe96
81 changed files with 556 additions and 750 deletions
|
|
@ -75,9 +75,12 @@ fn make_graph(N: uint, edges: ~[(node_id, node_id)]) -> graph {
|
|||
};
|
||||
|
||||
do vec::each(edges) |e| {
|
||||
let (i, j) = e;
|
||||
map::set_add(graph[i], j);
|
||||
map::set_add(graph[j], i);
|
||||
match *e {
|
||||
(i, j) => {
|
||||
map::set_add(graph[i], j);
|
||||
map::set_add(graph[j], i);
|
||||
}
|
||||
}
|
||||
true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,10 @@ fn run(args: &[~str]) {
|
|||
server(from_parent, to_parent);
|
||||
}
|
||||
|
||||
vec::iter(worker_results, |r| { future::get(&r); } );
|
||||
for vec::each(worker_results) |r| {
|
||||
future::get(r);
|
||||
}
|
||||
|
||||
//error!("sending stop message");
|
||||
to_child.send(stop);
|
||||
move_out!(to_child);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,10 @@ fn run(args: &[~str]) {
|
|||
server(from_parent, to_parent);
|
||||
}
|
||||
|
||||
vec::iter(worker_results, |r| { future::get(&r); } );
|
||||
for vec::each(worker_results) |r| {
|
||||
future::get(r);
|
||||
}
|
||||
|
||||
//error!("sending stop message");
|
||||
to_child.send(stop);
|
||||
move_out!(to_child);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@ fn run(args: ~[~str]) {
|
|||
}
|
||||
};
|
||||
}
|
||||
vec::iter(worker_results, |r| { future::get(&r); } );
|
||||
for vec::each(worker_results) |r| {
|
||||
future::get(r);
|
||||
}
|
||||
comm::send(to_child, stop);
|
||||
let result = comm::recv(from_child);
|
||||
let end = std::time::precise_time_s();
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ fn print_complements() {
|
|||
let all = ~[Blue, Red, Yellow];
|
||||
for vec::each(all) |aa| {
|
||||
for vec::each(all) |bb| {
|
||||
io::println(show_color(aa) + ~" + " + show_color(bb) +
|
||||
~" -> " + show_color(transform(aa,bb)));
|
||||
io::println(show_color(*aa) + ~" + " + show_color(*bb) +
|
||||
~" -> " + show_color(transform(*aa, *bb)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -171,7 +171,7 @@ fn rendezvous(nn: uint, set: ~[color]) {
|
|||
|
||||
// print each creature's stats
|
||||
for vec::each(report) |rep| {
|
||||
io::println(rep);
|
||||
io::println(*rep);
|
||||
}
|
||||
|
||||
// print the total number of creatures met
|
||||
|
|
|
|||
|
|
@ -31,9 +31,9 @@ fn calc(children: uint, parent_ch: comm::Chan<msg>) {
|
|||
|
||||
match comm::recv(port) {
|
||||
start => {
|
||||
do vec::iter (child_chs) |child_ch| {
|
||||
comm::send(child_ch, start);
|
||||
}
|
||||
for vec::each(child_chs) |child_ch| {
|
||||
comm::send(*child_ch, start);
|
||||
}
|
||||
}
|
||||
_ => fail ~"task-perf-one-million failed (port not in start state)"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue