mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 00:56:39 +08:00
Remove some pointless micro-optimizations
Seems to give around 1% speed-up for CPUs with popcnt support. Seems to give a very minor speed-up for CPUs without popcnt. No functional change Resolves #646
This commit is contained in:
@@ -501,8 +501,7 @@ bool Position::legal(Move m, Bitboard pinned) const {
|
||||
|
||||
// A non-king move is legal if and only if it is not pinned or it
|
||||
// is moving along the ray towards or away from the king.
|
||||
return !pinned
|
||||
|| !(pinned & from)
|
||||
return !(pinned & from)
|
||||
|| aligned(from, to_sq(m), square<KING>(us));
|
||||
}
|
||||
|
||||
@@ -595,8 +594,7 @@ bool Position::gives_check(Move m, const CheckInfo& ci) const {
|
||||
return true;
|
||||
|
||||
// Is there a discovered check?
|
||||
if ( ci.dcCandidates
|
||||
&& (ci.dcCandidates & from)
|
||||
if ( (ci.dcCandidates & from)
|
||||
&& !aligned(from, to, ci.ksq))
|
||||
return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user