mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Retire 'finished' from MovePicker
It is not useful becasue it is safe to call get_next_move() multiple times when phase == PH_STOP No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
5c8f571459
commit
c8af7a867e
2 changed files with 4 additions and 10 deletions
|
@ -74,7 +74,6 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d,
|
|||
const History& h, SearchStack* ss) : pos(p), H(h) {
|
||||
int searchTT = ttm;
|
||||
ttMoves[0].move = ttm;
|
||||
finished = false;
|
||||
lastBadCapture = badCaptures;
|
||||
|
||||
pinned = p.pinned_pieces(pos.side_to_move());
|
||||
|
@ -156,7 +155,7 @@ void MovePicker::go_next_phase() {
|
|||
return;
|
||||
|
||||
case PH_STOP:
|
||||
lastMove = curMove + 1; // hack to be friendly for get_next_move()
|
||||
lastMove = curMove + 1; // Avoids another go_next_phase() call
|
||||
return;
|
||||
|
||||
default:
|
||||
|
@ -346,14 +345,10 @@ Move MovePicker::get_next_move() {
|
|||
Move MovePicker::get_next_move(Lock &lock) {
|
||||
|
||||
lock_grab(&lock);
|
||||
if (finished)
|
||||
{
|
||||
lock_release(&lock);
|
||||
return MOVE_NONE;
|
||||
}
|
||||
|
||||
// Note that it is safe to call many times
|
||||
// get_next_move() when phase == PH_STOP
|
||||
Move m = get_next_move();
|
||||
if (m == MOVE_NONE)
|
||||
finished = true;
|
||||
|
||||
lock_release(&lock);
|
||||
return m;
|
||||
|
|
|
@ -64,7 +64,6 @@ private:
|
|||
const Position& pos;
|
||||
const History& H;
|
||||
MoveStack ttMoves[2], killers[2];
|
||||
bool finished;
|
||||
int phase;
|
||||
const uint8_t* phasePtr;
|
||||
MoveStack *curMove, *lastMove, *lastBadCapture;
|
||||
|
|
Loading…
Add table
Reference in a new issue