Avoid more expensive legality check
speedup of the code, enough to pass STC, failed LTC.
Passed STC:
LLR: 2.93 (-2.94,2.94) {-0.25,1.25}
Total: 68928 W: 6334 L: 6122 D: 56472
Ptnml(0-2): 233, 4701, 24369, 4943, 218
https://tests.stockfishchess.org/tests/view/6002747f6019e097de3ef8dc
Failed LTC:
LLR: -2.96 (-2.94,2.94) {0.25,1.25}
Total: 44560 W: 1702 L: 1675 D: 41183
Ptnml(0-2): 25, 1383, 19438, 1408, 26
https://tests.stockfishchess.org/tests/view/6002a4836019e097de3ef8e3
About 1% speedup:
Result of 50 runs
==================
base (...kfish.master) = 2237500 +/- 7428
test (...ckfish.patch) = 2267003 +/- 7017
diff = +29503 +/- 4774
speedup = +0.0132
P(speedup > 0) = 1.0000
closes https://github.com/official-stockfish/Stockfish/pull/3304
No functional change.