- if (step && ++*step, testPieceCounts)
- for (Color c = WHITE; c <= BLACK; ++c)
- for (PieceType pt = PAWN; pt <= KING; ++pt)
- if (pieceCount[c][pt] != popcount<Full>(pieces(c, pt)))
- return false;
-
- if (step && ++*step, testPieceList)
- for (Color c = WHITE; c <= BLACK; ++c)
- for (PieceType pt = PAWN; pt <= KING; ++pt)
- for (int i = 0; i < pieceCount[c][pt]; ++i)
- if ( board[pieceList[c][pt][i]] != make_piece(c, pt)
- || index[pieceList[c][pt][i]] != i)
+ if (step == Lists)
+ for (Color c = WHITE; c <= BLACK; ++c)
+ for (PieceType pt = PAWN; pt <= KING; ++pt)
+ {
+ if (pieceCount[c][pt] != popcount<Full>(pieces(c, pt)))