Skip to content

Commit 4700fae

Browse files
committed
---
yaml --- r: 96107 b: refs/heads/dist-snap c: d2bcc7b h: refs/heads/master i: 96105: 5c335af 96103: 4c098a7 v: v3
1 parent 01b3778 commit 4700fae

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
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 74d27311a7ecb50b4783b6adc4a977a6e51759b2
9+
refs/heads/dist-snap: d2bcc7b621b791f4abe7000a99816209a8ea7a45
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

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