diff options
| author | Graydon Hoare <graydon@mozilla.com> | 2011-05-16 18:21:22 -0700 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2011-05-16 18:21:22 -0700 |
| commit | fbbc1a77d242fafa1393127defa7ffec0bcb9e54 (patch) | |
| tree | ec83e08cb3fb8c95c24b7566ba8ab0904ced9aae /src/test/bench | |
| parent | ae030c5bf277e90b9aeea7e301fd3001f3a66b8d (diff) | |
| download | rust-fbbc1a77d242fafa1393127defa7ffec0bcb9e54.tar.gz rust-fbbc1a77d242fafa1393127defa7ffec0bcb9e54.zip | |
Rewrite everything to use [] instead of vec() in value position.
Diffstat (limited to 'src/test/bench')
| -rw-r--r-- | src/test/bench/shootout/fasta.rs | 12 | ||||
| -rw-r--r-- | src/test/bench/shootout/nbody.rs | 8 |
2 files changed, 10 insertions, 10 deletions
diff --git a/src/test/bench/shootout/fasta.rs b/src/test/bench/shootout/fasta.rs index ec962e38a48..b7a890971e3 100644 --- a/src/test/bench/shootout/fasta.rs +++ b/src/test/bench/shootout/fasta.rs @@ -28,10 +28,10 @@ type aminoacids = tup(char, u32); fn make_cumulative(vec[aminoacids] aa) -> vec[aminoacids] { let u32 cp = 0u32; - let vec[aminoacids] ans = vec(); + let vec[aminoacids] ans = []; for (aminoacids a in aa) { cp += a._1; - ans += vec(tup(a._0, cp)); + ans += [tup(a._0, cp)]; } ret ans; } @@ -91,7 +91,7 @@ fn make_repeat_fasta(str id, str desc, str s, int n) { } fn main(vec[str] args) { - let vec[aminoacids] iub = make_cumulative(vec(tup( 'a', 27u32 ), + let vec[aminoacids] iub = make_cumulative([tup( 'a', 27u32 ), tup( 'c', 12u32 ), tup( 'g', 12u32 ), tup( 't', 27u32 ), @@ -106,12 +106,12 @@ fn main(vec[str] args) { tup( 'S', 2u32 ), tup( 'V', 2u32 ), tup( 'W', 2u32 ), - tup( 'Y', 2u32 ))); + tup( 'Y', 2u32 )]); - let vec[aminoacids] homosapiens = make_cumulative(vec(tup( 'a', 30u32 ), + let vec[aminoacids] homosapiens = make_cumulative([tup( 'a', 30u32 ), tup( 'c', 20u32 ), tup( 'g', 20u32 ), - tup( 't', 30u32 ))); + tup( 't', 30u32 )]); let str alu = "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGG" + diff --git a/src/test/bench/shootout/nbody.rs b/src/test/bench/shootout/nbody.rs index 4b3e9044d92..152291c7145 100644 --- a/src/test/bench/shootout/nbody.rs +++ b/src/test/bench/shootout/nbody.rs @@ -7,7 +7,7 @@ native "llvm" mod llvm { fn main() { - let vec[int] inputs = vec( + let vec[int] inputs = [ 50000, 500000 // @@ -16,7 +16,7 @@ fn main() { // during 'make check' under valgrind // 5000000 // 50000000 - ); + ]; let vec[Body::props] bodies = NBodySystem::MakeNBodySystem(); @@ -38,13 +38,13 @@ fn main() { mod NBodySystem { fn MakeNBodySystem() -> vec[Body::props] { - let vec[Body::props] bodies = vec( + let vec[Body::props] bodies = [ // these each return a Body::props Body::sun(), Body::jupiter(), Body::saturn(), Body::uranus(), - Body::neptune()); + Body::neptune()]; let float px = 0.0; let float py = 0.0; |
