<commit_before>export parmap;

fn parmap<T:send, U:send>(v: [T], f: fn~(T) -> U) -> [U] {
    let futures = vec::map(v) {|elt|
        future::spawn {||
            f(elt)
        }
    };
    vec::map(futures) {|future|
        future::get(future)<commit_msg>rustdoc: Do less copying in util::parmap<commit_after>export parmap;

fn parmap<T:send, U:send>(v: [T], f: fn~(T) -> U) -> [U] unsafe {
    let futures = vec::map(v) {|elt|
        let po = comm::port();
        let ch = comm::chan(po);
        let addr = ptr::addr_of(elt);
        task::spawn {||
            comm::send(ch, f(*addr));
        }
        po
    };
    vec::map(futures) {|future|
        comm::recv(future)
{'fraction_non_alphanumeric': 0.2020497803806735, 'fraction_numerical': 0.0, 'mean_word_length': 2.3365853658536584, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5679963', 'n_tokens_mistral': 263, 'n_tokens_neox': 256, 'n_words': 54}