To have uniformity with moves array handling.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
ttMoves[1].move = killers[0].move = killers[1].move = MOVE_NONE;
finished = false;
ttMoves[1].move = killers[0].move = killers[1].move = MOVE_NONE;
finished = false;
+ lastBadCapture = badCaptures;
Color us = pos.side_to_move();
Color us = pos.side_to_move();
// Bad captures SEE value is already calculated so just sort them
// to get SEE move ordering.
curMove = badCaptures;
// Bad captures SEE value is already calculated so just sort them
// to get SEE move ordering.
curMove = badCaptures;
- lastMove = badCaptures + numOfBadCaptures;
+ lastMove = lastBadCapture;
std::sort(badCaptures, lastMove);
return;
std::sort(badCaptures, lastMove);
return;
// Losing capture, move it to the badCaptures[] array, note
// that move has now been already checked for legality.
// Losing capture, move it to the badCaptures[] array, note
// that move has now been already checked for legality.
- assert(numOfBadCaptures < 63);
- badCaptures[numOfBadCaptures].move = move;
- badCaptures[numOfBadCaptures++].score = seeValue;
+ assert(int(lastBadCapture - badCaptures) < 63);
+ lastBadCapture->move = move;
+ lastBadCapture->score = seeValue;
+ lastBadCapture++;
const History& H;
MoveStack ttMoves[2], killers[2];
bool finished;
const History& H;
MoveStack ttMoves[2], killers[2];
bool finished;
- int numOfBadCaptures, phase;
const MovegenPhaseT* phasePtr;
const MovegenPhaseT* phasePtr;
- MoveStack *curMove, *lastMove;
+ MoveStack *curMove, *lastMove, *lastBadCapture;
Bitboard dc, pinned;
MoveStack moves[256], badCaptures[64];
};
Bitboard dc, pinned;
MoveStack moves[256], badCaptures[64];
};