X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=49935904bdc5b03afa2418bd342140a000861fe6;hp=67cf2a02522c7f062d0cc41c647e01bb6463e91d;hb=ae6a4ebf1f44cb05e96f8f33342ec281b41b0cc0;hpb=fa1e3427bdf7f6347326015a381014564e8fb337 diff --git a/src/position.cpp b/src/position.cpp index 67cf2a02..49935904 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -450,19 +450,6 @@ const string Position::fen() const { } -/// Position::game_phase() calculates the game phase interpolating total non-pawn -/// material between endgame and midgame limits. - -Phase Position::game_phase() const { - - Value npm = st->nonPawnMaterial[WHITE] + st->nonPawnMaterial[BLACK]; - - npm = std::max(EndgameLimit, std::min(npm, MidgameLimit)); - - return Phase(((npm - EndgameLimit) * PHASE_MIDGAME) / (MidgameLimit - EndgameLimit)); -} - - /// Position::slider_blockers() returns a bitboard of all the pieces (both colors) /// that are blocking attacks on the square 's' from 'sliders'. A piece blocks a /// slider if removing that piece from the board would result in a position where @@ -690,7 +677,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) { assert(is_ok(m)); assert(&newSt != st); - ++nodes; + thisThread->nodes.fetch_add(1, std::memory_order_relaxed); Key k = st->key ^ Zobrist::side; // Copy some fields of the old state to our new StateInfo object except the