Skip to content

Commit 8480120

Browse files
committed
---
yaml --- r: 93695 b: refs/heads/try c: d2bcc7b h: refs/heads/master i: 93693: 0e8b450 93691: 11bdae5 93687: 93fbb59 93679: 3d05441 93663: 4c99cbc 93631: 2a51141 93567: fa98e18 93439: dcb0b1b 93183: 0cc7a31 v: v3
1 parent 79c7342 commit 8480120

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: 74d27311a7ecb50b4783b6adc4a977a6e51759b2
5+
refs/heads/try: d2bcc7b621b791f4abe7000a99816209a8ea7a45
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,21 @@ impl<'self, T> Iterator<&'self T> for ListIterator<'self, T> {
6363
// corresponding mirrored piece), with, as minimum coordinates, (0,
6464
// 0). If all is false, only generate half of the possibilities (used
6565
// to break the symetry of the board).
66-
fn transform(p: ~[(int, int)], all: bool) -> ~[~[(int, int)]] {
66+
fn transform(piece: ~[(int, int)], all: bool) -> ~[~[(int, int)]] {
6767
let mut res =
6868
// rotations
69-
iterate(p, |p| p.iter().map(|&(y, x)| (x + y, -y)).collect())
69+
iterate(piece, |rot| rot.iter().map(|&(y, x)| (x + y, -y)).collect())
7070
.take(if all {6} else {3})
7171
// mirror
72-
.flat_map(|p| {
73-
iterate(p, |p| p.iter().map(|&(y, x)| (x, y)).collect()).take(2)
72+
.flat_map(|cur_piece| {
73+
iterate(cur_piece, |mir| mir.iter().map(|&(y, x)| (x, y)).collect())
74+
.take(2)
7475
}).to_owned_vec();
7576

7677
// translating to (0, 0) as minimum coordinates.
77-
for p in res.mut_iter() {
78-
let (dy, dx) = *p.iter().min_by(|e| *e).unwrap();
79-
for &(ref mut y, ref mut x) in p.mut_iter() {
78+
for cur_piece in res.mut_iter() {
79+
let (dy, dx) = *cur_piece.iter().min_by(|e| *e).unwrap();
80+
for &(ref mut y, ref mut x) in cur_piece.mut_iter() {
8081
*y -= dy; *x -= dx;
8182
}
8283
}

0 commit comments

Comments
 (0)