X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmovepick.cpp;h=190a30f8c8c613f22dcd8351ed3609ce1ac66986;hb=6c040c821a50475840607ef5f11c270ee21d61da;hp=3baf4f700b59cd52ab30c5a13d625bdbecd2027e;hpb=1d5eaba5735e24c3afdeb07a5108d7ebf9e3ff57;p=stockfish diff --git a/src/movepick.cpp b/src/movepick.cpp index 3baf4f70..190a30f8 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -52,7 +52,7 @@ namespace { // pick_best() finds the best move in the range (begin, end) and moves it to // the front. It's faster than sorting all the moves in advance when there // are few moves e.g. the possible captures. - inline Move pick_best(ExtMove* begin, ExtMove* end) + Move pick_best(ExtMove* begin, ExtMove* end) { std::swap(*begin, *std::max_element(begin, end)); return *begin; @@ -68,12 +68,12 @@ namespace { /// ordering is at the current node. MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const HistoryStats& h, const CounterMovesHistoryStats& cmh, - Move* cm, Search::Stack* s) : pos(p), history(h), counterMovesHistory(cmh), depth(d) { + Move cm, Search::Stack* s) : pos(p), history(h), counterMovesHistory(cmh), depth(d) { assert(d > DEPTH_ZERO); endBadCaptures = moves + MAX_MOVES - 1; - countermoves = cm; + countermove = cm; ss = s; if (pos.checkers()) @@ -167,7 +167,7 @@ void MovePicker::score() { for (auto& m : *this) m.value = history[pos.moved_piece(m)][to_sq(m)] - + cmh[pos.moved_piece(m)][to_sq(m)]; + + cmh[pos.moved_piece(m)][to_sq(m)] * 3; } template<> @@ -209,16 +209,12 @@ void MovePicker::generate_next_stage() { killers[0] = ss->killers[0]; killers[1] = ss->killers[1]; - killers[2].move = killers[3].move = MOVE_NONE; + killers[2].move = MOVE_NONE; - // In SMP case countermoves[] could have duplicated entries - // in rare cases (less than 1 out of a million). This is harmless. - - // Be sure countermoves and followupmoves are different from killers - for (int i = 0; i < 2; ++i) - if ( countermoves[i] != killers[0] - && countermoves[i] != killers[1]) - *endMoves++ = countermoves[i]; + // Be sure countermoves are different from killers + if ( countermove != killers[0] + && countermove != killers[1]) + *endMoves++ = countermove; break; case QUIETS_1_S1: @@ -311,8 +307,7 @@ Move MovePicker::next_move() { if ( move != ttMove && move != killers[0] && move != killers[1] - && move != killers[2] - && move != killers[3]) + && move != killers[2]) return move; break;