Skip to content

Commit dee9578

Browse files
committed
---
yaml --- r: 16127 b: refs/heads/try c: 09a32ae h: refs/heads/master i: 16125: 8bf02e1 16123: d5ee778 16119: 55723b2 16111: 3ed10b2 16095: fe1a6e8 16063: 810f4c8 15999: 5ba5733 15871: efa7bc9 v: v3
1 parent 69bc0eb commit dee9578

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 58fdbdc4ef7cee014775bafff23830900fcaf3ca
5+
refs/heads/try: 09a32aedb5ae56cabac371ba9af7cce631becf51
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/libstd/par.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ fn map_slices<A: copy send, B: copy send>(
7575
#[doc="A parallel version of map."]
7676
fn map<A: copy send, B: copy send>(xs: [A], f: fn~(A) -> B) -> [B] {
7777
vec::concat(map_slices(xs) {||
78-
fn~(_base: uint, slice : [const A]/&) -> [B] {
78+
fn~(_base: uint, slice : [const A]/&, copy f) -> [B] {
7979
vec::map(slice, f)
8080
}
8181
})
@@ -84,7 +84,7 @@ fn map<A: copy send, B: copy send>(xs: [A], f: fn~(A) -> B) -> [B] {
8484
#[doc="A parallel version of mapi."]
8585
fn mapi<A: copy send, B: copy send>(xs: [A], f: fn~(uint, A) -> B) -> [B] {
8686
let slices = map_slices(xs) {||
87-
fn~(base: uint, slice : [const A]/&) -> [B] {
87+
fn~(base: uint, slice : [const A]/&, copy f) -> [B] {
8888
vec::mapi(slice) {|i, x|
8989
f(i + base, x)
9090
}
@@ -104,7 +104,7 @@ fn mapi_factory<A: copy send, B: copy send>(
104104
xs: [A], f: fn() -> fn~(uint, A) -> B) -> [B] {
105105
let slices = map_slices(xs) {||
106106
let f = f();
107-
fn~(base: uint, slice : [const A]/&) -> [B] {
107+
fn~(base: uint, slice : [const A]/&, move f) -> [B] {
108108
vec::mapi(slice) {|i, x|
109109
f(i + base, x)
110110
}
@@ -118,16 +118,20 @@ fn mapi_factory<A: copy send, B: copy send>(
118118

119119
#[doc="Returns true if the function holds for all elements in the vector."]
120120
fn alli<A: copy send>(xs: [A], f: fn~(uint, A) -> bool) -> bool {
121-
vec::all(map_slices(xs) {|| fn~(base: uint, slice : [const A]/&) -> bool {
122-
vec::alli(slice) {|i, x|
123-
f(i + base, x)
121+
vec::all(map_slices(xs) {||
122+
fn~(base: uint, slice : [const A]/&, copy f) -> bool {
123+
vec::alli(slice) {|i, x|
124+
f(i + base, x)
125+
}
124126
}
125-
}}) {|x| x }
127+
}) {|x| x }
126128
}
127129

128130
#[doc="Returns true if the function holds for any elements in the vector."]
129131
fn any<A: copy send>(xs: [A], f: fn~(A) -> bool) -> bool {
130-
vec::any(map_slices(xs) {|| fn~(_base : uint, slice: [const A]/&) -> bool {
131-
vec::any(slice, f)
132-
}}) {|x| x }
132+
vec::any(map_slices(xs) {||
133+
fn~(_base : uint, slice: [const A]/&, copy f) -> bool {
134+
vec::any(slice, f)
135+
}
136+
}) {|x| x }
133137
}

branches/try/src/test/bench/graph500-bfs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ fn main(args: [str]) {
384384
let scale = uint::from_str(args[1]).get();
385385
let num_keys = uint::from_str(args[2]).get();
386386
let do_validate = false;
387-
let do_sequential = false;
387+
let do_sequential = true;
388388

389389
let start = time::precise_time_s();
390390
let edges = make_edges(scale, 16u);

0 commit comments

Comments
 (0)