mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 16:47:37 +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:
+3
-4
@@ -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;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user