Skip to content

Commit c3a1256

Browse files
committed
Aplicar pequena otimização
1 parent 4201920 commit c3a1256

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/src/cube.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1150,11 +1150,11 @@ class Cube extends Equatable {
11501150

11511151
static List<Rotation> _findRotation(List<Color> input) {
11521152
return [
1153-
for (var i = 4; i < 54; i += 9)
1154-
if (input[i] == Color.up && _orientation[0][i ~/ 9] != null)
1155-
_orientation[0][i ~/ 9]
1156-
else if (input[i] == Color.right && _orientation[1][i ~/ 9] != null)
1157-
_orientation[1][i ~/ 9]
1153+
for (var i = 4, k = 0; i < 54; i += 9, k++)
1154+
if (input[i] == Color.up && _orientation[0][k] != null)
1155+
_orientation[0][k]
1156+
else if (input[i] == Color.right && _orientation[1][k] != null)
1157+
_orientation[1][k]
11581158
];
11591159
}
11601160

@@ -1251,7 +1251,7 @@ class Cube extends Equatable {
12511251
];
12521252
}
12531253

1254-
/// Generates a SVG image of 3 faces of the [Cube].
1254+
/// Generates an SVG image of the [Cube].
12551255
String svg({
12561256
int width = 1024,
12571257
int height = 1024,

0 commit comments

Comments
 (0)