X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovepick.h;h=db0ba3c465e4e8b5aacc832c6bff57955480ba9d;hp=d6451f6bf0ad4575212802a1708c4792a2ce5887;hb=9c35b9365d75a3522cee47536419534b1de91f48;hpb=01d97521fd675ed157ff7d61e6057916abbcc56c diff --git a/src/movepick.h b/src/movepick.h index d6451f6b..db0ba3c4 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -38,12 +38,8 @@ struct StatBoards : public std::array, Size1> { void update(T& entry, int bonus, const int D) { - assert([&]{ - int v = entry + bonus * 32 - entry * abs(bonus) / D; - return INT16_MIN < v && v < INT16_MAX; - }()); - - assert(abs(bonus) <= D); // Consistency check for below formula + assert(abs(bonus) <= D); // Ensure range is [-32 * D, 32 * D] + assert(abs(32 * D) < INT16_MAX); // Ensure we don't overflow entry += bonus * 32 - entry * abs(bonus) / D;