Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tamird committed Apr 22, 2015
1 parent 2baf348 commit c261a07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/test/bench/shootout-k-nucleotide-pipes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@

// multi tasking k-nucleotide

#![allow(bad_style)]

use std::ascii::AsciiExt;
use std::cmp::Ordering::{self, Less, Greater, Equal};
use std::collections::HashMap;
Expand Down Expand Up @@ -47,7 +45,7 @@ fn sort_and_fmt(mm: &HashMap<Vec<u8> , usize>, total: usize) -> String {
}

// sort by key, then by value
fn sortKV(mut orig: Vec<(Vec<u8> ,f64)> ) -> Vec<(Vec<u8> ,f64)> {
fn sort_kv(mut orig: Vec<(Vec<u8> ,f64)> ) -> Vec<(Vec<u8> ,f64)> {
orig.sort_by(|&(ref a, _), &(ref b, _)| a.cmp(b));
orig.sort_by(|&(_, a), &(_, b)| f64_cmp(b, a));
orig
Expand All @@ -60,7 +58,7 @@ fn sort_and_fmt(mm: &HashMap<Vec<u8> , usize>, total: usize) -> String {
pairs.push(((*key).clone(), pct(val, total)));
}

let pairs_sorted = sortKV(pairs);
let pairs_sorted = sort_kv(pairs);

let mut buffer = String::new();
for &(ref k, v) in &pairs_sorted {
Expand Down
2 changes: 1 addition & 1 deletion src/test/bench/shootout-reverse-complement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fn parallel<I: Iterator, F>(iter: I, ref f: F)

fn main() {
let mut data = Vec::with_capacity(1024 * 1024);
io::stdin().read_to_end(&mut data);
io::stdin().read_to_end(&mut data).unwrap();
let tables = &Tables::new();
parallel(mut_dna_seqs(&mut data), |seq| reverse_complement(seq, tables));
io::stdout().write_all(&data).unwrap();
Expand Down

0 comments on commit c261a07

Please sign in to comment.