1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Small simplification in gives_check

Use switch statement also for normal case.

No speed regression.

No functional change.
This commit is contained in:
Marco Costalba 2014-03-11 22:58:08 +01:00
parent ca0804dfe4
commit c40d4e0133

View file

@ -596,12 +596,11 @@ bool Position::gives_check(Move m, const CheckInfo& ci) const {
&& !aligned(from, to, ci.ksq))
return true;
// Can we skip the ugly special cases?
if (type_of(m) == NORMAL)
return false;
switch (type_of(m))
{
case NORMAL:
return false;
case PROMOTION:
return attacks_bb(Piece(promotion_type(m)), to, pieces() ^ from) & ci.ksq;