Skip to content

Commit a584a9f

Browse files
committed
---
yaml --- r: 30456 b: refs/heads/incoming c: 10aa849 h: refs/heads/master v: v3
1 parent 50b8997 commit a584a9f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: 7e9f98a8c95588b7c88e5d4b4db1890e086257ee
9+
refs/heads/incoming: 10aa849d28d74c2c332f24a0da55833c95d91ab1
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/test/bench/shootout-k-nucleotide-pipes.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,30 @@ use std::map::hashmap;
88
use std::sort;
99
use io::ReaderUtil;
1010
use pipes::{stream, Port, Chan};
11+
use cmp::Ord;
1112

1213
// given a map, print a sorted version of it
1314
fn sort_and_fmt(mm: hashmap<~[u8], uint>, total: uint) -> ~str {
1415
fn pct(xx: uint, yy: uint) -> float {
1516
return (xx as float) * 100f / (yy as float);
1617
}
1718

18-
pure fn le_by_val<TT: Copy, UU: Copy>(kv0: &(TT,UU),
19+
pure fn le_by_val<TT: Copy, UU: Copy Ord>(kv0: &(TT,UU),
1920
kv1: &(TT,UU)) -> bool {
2021
let (_, v0) = *kv0;
2122
let (_, v1) = *kv1;
2223
return v0 >= v1;
2324
}
2425

25-
pure fn le_by_key<TT: Copy, UU: Copy>(kv0: &(TT,UU),
26+
pure fn le_by_key<TT: Copy Ord, UU: Copy>(kv0: &(TT,UU),
2627
kv1: &(TT,UU)) -> bool {
2728
let (k0, _) = *kv0;
2829
let (k1, _) = *kv1;
2930
return k0 <= k1;
3031
}
3132

3233
// sort by key, then by value
33-
fn sortKV<TT: Copy, UU: Copy>(orig: ~[(TT,UU)]) -> ~[(TT,UU)] {
34+
fn sortKV<TT: Copy Ord, UU: Copy Ord>(orig: ~[(TT,UU)]) -> ~[(TT,UU)] {
3435
return sort::merge_sort(le_by_val, sort::merge_sort(le_by_key, orig));
3536
}
3637

branches/incoming/src/test/bench/shootout-k-nucleotide.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use std::map;
77
use std::map::hashmap;
88
use std::sort;
99
use io::ReaderUtil;
10+
use cmp::Ord;
1011

1112
// given a map, print a sorted version of it
1213
fn sort_and_fmt(mm: hashmap<~[u8], uint>, total: uint) -> ~str {

0 commit comments

Comments
 (0)