mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43: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:
parent
ca0804dfe4
commit
c40d4e0133
1 changed files with 3 additions and 4 deletions
|
@ -596,12 +596,11 @@ bool Position::gives_check(Move m, const CheckInfo& ci) const {
|
||||||
&& !aligned(from, to, ci.ksq))
|
&& !aligned(from, to, ci.ksq))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// Can we skip the ugly special cases?
|
|
||||||
if (type_of(m) == NORMAL)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
switch (type_of(m))
|
switch (type_of(m))
|
||||||
{
|
{
|
||||||
|
case NORMAL:
|
||||||
|
return false;
|
||||||
|
|
||||||
case PROMOTION:
|
case PROMOTION:
|
||||||
return attacks_bb(Piece(promotion_type(m)), to, pieces() ^ from) & ci.ksq;
|
return attacks_bb(Piece(promotion_type(m)), to, pieces() ^ from) & ci.ksq;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue