mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Use pointers instead of array indices also for badCaptures
To have uniformity with moves array handling. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
97dd7568ed
commit
c9d364f9ca
2 changed files with 8 additions and 7 deletions
|
@ -73,7 +73,7 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d,
|
|||
ttMoves[1].move = killers[0].move = killers[1].move = MOVE_NONE;
|
||||
|
||||
finished = false;
|
||||
numOfBadCaptures = 0;
|
||||
lastBadCapture = badCaptures;
|
||||
|
||||
Color us = pos.side_to_move();
|
||||
|
||||
|
@ -129,7 +129,7 @@ void MovePicker::go_next_phase() {
|
|||
// 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;
|
||||
|
||||
|
@ -278,9 +278,10 @@ Move MovePicker::get_next_move() {
|
|||
|
||||
// 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++;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -80,9 +80,9 @@ private:
|
|||
const History& H;
|
||||
MoveStack ttMoves[2], killers[2];
|
||||
bool finished;
|
||||
int numOfBadCaptures, phase;
|
||||
int phase;
|
||||
const MovegenPhaseT* phasePtr;
|
||||
MoveStack *curMove, *lastMove;
|
||||
MoveStack *curMove, *lastMove, *lastBadCapture;
|
||||
Bitboard dc, pinned;
|
||||
MoveStack moves[256], badCaptures[64];
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue