mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +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;
|
ttMoves[1].move = killers[0].move = killers[1].move = MOVE_NONE;
|
||||||
|
|
||||||
finished = false;
|
finished = false;
|
||||||
numOfBadCaptures = 0;
|
lastBadCapture = badCaptures;
|
||||||
|
|
||||||
Color us = pos.side_to_move();
|
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
|
// Bad captures SEE value is already calculated so just sort them
|
||||||
// to get SEE move ordering.
|
// to get SEE move ordering.
|
||||||
curMove = badCaptures;
|
curMove = badCaptures;
|
||||||
lastMove = badCaptures + numOfBadCaptures;
|
lastMove = lastBadCapture;
|
||||||
std::sort(badCaptures, lastMove);
|
std::sort(badCaptures, lastMove);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -278,9 +278,10 @@ Move MovePicker::get_next_move() {
|
||||||
|
|
||||||
// Losing capture, move it to the badCaptures[] array, note
|
// Losing capture, move it to the badCaptures[] array, note
|
||||||
// that move has now been already checked for legality.
|
// that move has now been already checked for legality.
|
||||||
assert(numOfBadCaptures < 63);
|
assert(int(lastBadCapture - badCaptures) < 63);
|
||||||
badCaptures[numOfBadCaptures].move = move;
|
lastBadCapture->move = move;
|
||||||
badCaptures[numOfBadCaptures++].score = seeValue;
|
lastBadCapture->score = seeValue;
|
||||||
|
lastBadCapture++;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -80,9 +80,9 @@ private:
|
||||||
const History& H;
|
const History& H;
|
||||||
MoveStack ttMoves[2], killers[2];
|
MoveStack ttMoves[2], killers[2];
|
||||||
bool finished;
|
bool finished;
|
||||||
int numOfBadCaptures, phase;
|
int phase;
|
||||||
const MovegenPhaseT* phasePtr;
|
const MovegenPhaseT* phasePtr;
|
||||||
MoveStack *curMove, *lastMove;
|
MoveStack *curMove, *lastMove, *lastBadCapture;
|
||||||
Bitboard dc, pinned;
|
Bitboard dc, pinned;
|
||||||
MoveStack moves[256], badCaptures[64];
|
MoveStack moves[256], badCaptures[64];
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue