diff options
Diffstat (limited to 'src/test/bench/shootout-reverse-complement.rs')
| -rw-r--r-- | src/test/bench/shootout-reverse-complement.rs | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/test/bench/shootout-reverse-complement.rs b/src/test/bench/shootout-reverse-complement.rs index e286efeb304..d9dfd65d5b3 100644 --- a/src/test/bench/shootout-reverse-complement.rs +++ b/src/test/bench/shootout-reverse-complement.rs @@ -182,7 +182,7 @@ fn reverse_complement(seq: &mut [u8], tables: &Tables) { unsafe { copy_memory(seq.as_mut_ptr().offset((i - off + 1) as int), seq.as_ptr().offset((i - off) as int), off); - *seq.unsafe_mut(i - off) = b'\n'; + *seq.get_unchecked_mut(i - off) = b'\n'; } i += LINE_LEN + 1; } @@ -237,27 +237,18 @@ fn parallel<'a, I, T, F>(mut iter: I, f: F) iter.map(|chunk| { // Need to convert `f` and `chunk` to something that can cross the task // boundary. -<<<<<<< HEAD let f = Racy(&f as *const F as *const uint); let raw = Racy(chunk.repr()); - spawn(move|| { + Thread::spawn(move|| { let f = f.0 as *const F; unsafe { (*f)(mem::transmute(raw.0)) } - drop(tx) -======= - let f = &f as *const F as *const uint; - let raw = chunk.repr(); - Thread::spawn(move|| { - let f = f as *const F; - unsafe { (*f)(mem::transmute(raw)) } ->>>>>>> std: Stabilize the prelude module - }); + }) }).collect::<Vec<_>>(); } fn main() { let mut data = read_to_end(&mut stdin_raw()).unwrap(); let tables = &Tables::new(); - parallel(mut_dna_seqs(data[mut]), |&: seq| reverse_complement(seq, tables)); + parallel(mut_dna_seqs(data.as_mut_slice()), |&: seq| reverse_complement(seq, tables)); stdout_raw().write(data.as_mut_slice()).unwrap(); } |
