mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-25 03:26:24 +08:00
Small simplification in gives_check
Use switch statement also for normal case. No speed regression. No functional change.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user