Skip to content

Commit 4e116a6

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 171247 b: refs/heads/batch c: a9ea4d0 h: refs/heads/master i: 171245: a143507 171243: 94009de 171239: 0d6defd 171231: aa82600 v: v3
1 parent 5b00a6c commit 4e116a6

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
3030
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32-
refs/heads/batch: ef726591f81238f19bfd4cc3b48d812d20dbfcc2
32+
refs/heads/batch: a9ea4d0127baf913cd1831b2fa1d527aaadf6ba9
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 496dc4eae7de9d14cd49511a9acfbf5f11ae6c3f
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928

branches/batch/src/test/bench/core-set.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,14 @@ impl MutableSet<uint> for BitvSet {
6161

6262
impl Results {
6363
pub fn bench_int<T:MutableSet<uint>,
64-
R: rand::Rng>(
64+
R:rand::Rng,
65+
F:FnMut() -> T>(
6566
&mut self,
6667
rng: &mut R,
6768
num_keys: uint,
6869
rand_cap: uint,
69-
f: || -> T) { {
70+
mut f: F) {
71+
{
7072
let mut set = f();
7173
timed(&mut self.sequential_ints, || {
7274
for i in range(0u, num_keys) {
@@ -103,11 +105,12 @@ impl Results {
103105
}
104106

105107
pub fn bench_str<T:MutableSet<String>,
106-
R:rand::Rng>(
108+
R:rand::Rng,
109+
F:FnMut() -> T>(
107110
&mut self,
108111
rng: &mut R,
109112
num_keys: uint,
110-
f: || -> T) {
113+
mut f: F) {
111114
{
112115
let mut set = f();
113116
timed(&mut self.sequential_strings, || {

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,9 @@ fn update_freq(mm: &mut HashMap<Vec<u8> , uint>, key: &[u8]) {
9494
// given a Vec<u8>, for each window call a function
9595
// i.e., for "hello" and windows of size four,
9696
// run it("hell") and it("ello"), then return "llo"
97-
fn windows_with_carry(bb: &[u8], nn: uint, it: |window: &[u8]|) -> Vec<u8> {
97+
fn windows_with_carry<F>(bb: &[u8], nn: uint, mut it: F) -> Vec<u8> where
98+
F: FnMut(&[u8]),
99+
{
98100
let mut ii = 0u;
99101

100102
let len = bb.len();

branches/batch/src/test/bench/shootout-meteor.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ use std::thread::Thread;
5353

5454
// returns an infinite iterator of repeated applications of f to x,
5555
// i.e. [x, f(x), f(f(x)), ...], as haskell iterate function.
56-
fn iterate<'a, T>(x: T, f: |&T|: 'a -> T) -> Iterate<'a, T> {
56+
fn iterate<T, F>(x: T, f: F) -> Iterate<T, F> where F: FnMut(&T) -> T {
5757
Iterate {f: f, next: x}
5858
}
59-
struct Iterate<'a, T> {
60-
f: |&T|: 'a -> T,
59+
struct Iterate<T, F> where F: FnMut(&T) -> T {
60+
f: F,
6161
next: T
6262
}
63-
impl<'a, T> Iterator for Iterate<'a, T> {
63+
impl<T, F> Iterator for Iterate<T, F> where F: FnMut(&T) -> T {
6464
type Item = T;
6565

6666
fn next(&mut self) -> Option<T> {

0 commit comments

Comments
 (0)