Simplify signature of remove_piece()
authorprotonspring <mike@whiteley.org>
Sat, 21 Dec 2019 22:36:29 +0000 (15:36 -0700)
committerStéphane Nicolet <cassio@free.fr>
Thu, 23 Jan 2020 16:31:45 +0000 (17:31 +0100)
commit7a7bcd6359b38651e1bfecf78aa07e633abed5b2
tree0b5b5ede00b196b3bd1260b86c1ebbdc2c17c8ca
parentbcf9282844f17dbb451231d8ae0a957d1b7be43d
Simplify signature of remove_piece()

This is a non-functional simplification. Instead of passing the piece type
for remove_piece, we can rely on the board. The only exception is en-passant
which must be explicitly set because the destination square for the capture
is not the same as the piece to remove.

Verified also in the Chess960 castling case by running a couple of perft, see
the pull request discussion: https://github.com/official-stockfish/Stockfish/pull/2460

STC
LLR: 2.94 (-2.94,2.94) [-3.00,1.00]
Total: 18624 W: 4147 L: 4070 D: 10407
Ptnml(0-2): 223, 1933, 4945, 1938, 260
http://tests.stockfishchess.org/tests/view/5dfeaa93e70446e17e451163

No functional change
src/position.cpp
src/position.h