Skip to content

Commit acf0c8e

Browse files
authored
Ignore pieces with only one state during solving. (#1323)
Straight up dumb off-by-one error. Oops! This should make the solver a little faster (though it mostly uses the piece state map to look up states, so the shorter piece list won't have a huge effect).
1 parent f565eb3 commit acf0c8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/src/back_end/solver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Solver {
4242

4343
void traverse(Piece piece) {
4444
// We don't need to worry about selecting pieces that have only one state.
45-
if (piece.states.isNotEmpty) unsolvedPieces.add(piece);
45+
if (piece.states.length > 1) unsolvedPieces.add(piece);
4646
piece.forEachChild(traverse);
4747
}
4848

0 commit comments

Comments
 (0)