X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmaterial.cpp;h=2e68ee68dd333a5042d524370b2d5e56fb95c5df;hp=773f332f20fddfdcebfacf441af9b2f18b19bd82;hb=c8589903777b6e0289640b43fae966ded442af48;hpb=d1f76ebcd8cc475d08b468efe4b467e014efef14 diff --git a/src/material.cpp b/src/material.cpp index 773f332f..2e68ee68 100644 --- a/src/material.cpp +++ b/src/material.cpp @@ -18,7 +18,6 @@ along with this program. If not, see . */ -#include // For std::min #include #include // For std::memset @@ -130,7 +129,7 @@ Entry* probe(const Position& pos) { Value npm_w = pos.non_pawn_material(WHITE); Value npm_b = pos.non_pawn_material(BLACK); - Value npm = std::max(EndgameLimit, std::min(npm_w + npm_b, MidgameLimit)); + Value npm = clamp(npm_w + npm_b, EndgameLimit, MidgameLimit); // Map total non-pawn material into [PHASE_ENDGAME, PHASE_MIDGAME] e->gamePhase = Phase(((npm - EndgameLimit) * PHASE_MIDGAME) / (MidgameLimit - EndgameLimit));