]> git.sesse.net Git - stockfish/commit
Fix pos.count<ALL_PIECES>()
authorMarco Costalba <mcostalba@gmail.com>
Sun, 20 Oct 2013 21:35:10 +0000 (23:35 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 20 Oct 2013 21:36:46 +0000 (23:36 +0200)
commitf22a63ce67fecabe14dd4e558af9483b592efcfa
treec91c4e2bc10bfc086b5495206cb2753e573ed9e4
parentc08e7419a08a9060613bf3190a33997d1f9a535f
Fix pos.count<ALL_PIECES>()

It was never updated !

Currently it only affects evaluate_passed_pawns()
and in particularly the rule to increase the bonus
if we have more non-pawn pieces. We could simply use
popcount() instead and avoid the little slowdown
in put_piece() and remove_piece(), but this would
leave a very subtle and tricky hole where people
are forced to remember that pos.count<ALL_PIECES>()
does not work. This is not obvious and so dangerous.

Thanks to Ronald de Man for spotting this.

bench: 7931424
src/position.h