-inline void History::update_gain(Piece p, Square to, Value gain) {
-
- if (gain >= maxGains[p][to])
- maxGains[p][to] = gain;
- else
- maxGains[p][to]--;
+inline void History::update_gain(Piece p, Square to, Value g) {
+ maxGains[p][to] = Max(g, maxGains[p][to] - 1);