Skip to content

Commit 4d67225

Browse files
committed
---
yaml --- r: 21748 b: refs/heads/snap-stage3 c: 10aa849 h: refs/heads/master v: v3
1 parent f57d0dd commit 4d67225

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 7e9f98a8c95588b7c88e5d4b4db1890e086257ee
4+
refs/heads/snap-stage3: 10aa849d28d74c2c332f24a0da55833c95d91ab1
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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)