Skip to content

Commit

Permalink
Ignore pieces with only one state during solving. (#1323)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
munificent authored Nov 16, 2023
1 parent f565eb3 commit acf0c8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/back_end/solver.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Solver {

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

Expand Down

0 comments on commit acf0c8e

Please sign in to comment.