}
fn buffer_ty_path(cx: ext_ctxt) -> @ast::ty {
- let mut params = ~[];
+ let mut params: ~[ast::ty_param] = ~[];
for (copy self.states).each |s| {
for s.ty_params.each |tp| {
- if !params.contains(tp) {
- vec::push(params, tp);
+ alt params.find(|tpp| *tp.ident == *tpp.ident) {
+ none { vec::push(params, tp) }
+ _ { }
}
}
}
fn gen_buffer_type(cx: ext_ctxt) -> @ast::item {
let ext_cx = cx;
- let mut params = ~[];
+ let mut params: ~[ast::ty_param] = ~[];
let fields = do (copy self.states).map_to_vec |s| {
for s.ty_params.each |tp| {
- if !params.contains(tp) {
- vec::push(params, tp);
+ alt params.find(|tpp| *tp.ident == *tpp.ident) {
+ none { vec::push(params, tp) }
+ _ { }
}
}
let ty = s.to_ty(cx);
proto! ctrl_proto {
open: send<K: copy send, V: copy send> {
find_reducer(K) -> reducer_response<K, V>,
- mapper_done -> terminated
+ mapper_done -> !
}
reducer_response: recv<K: copy send, V: copy send> {
reducer(chan<reduce_proto<V>>) -> open<K, V>
}
-
- terminated: send { }
}
enum reduce_proto<V: copy send> { emit_val(V), done, ref, release }
while num_mappers > 0 {
let (_ready, message, ctrls) = pipes::select(ctrl);
alt option::unwrap(message) {
- ctrl_proto::mapper_done(_) {
+ ctrl_proto::mapper_done {
// #error("received mapper terminated.");
num_mappers -= 1;
ctrl = ctrls;