Reuse computed ray bitboard in update_piece_threats

Reuse the already-computed ray instead of calling ray_pass_bb a second time with identical arguments.

closes https://github.com/official-stockfish/Stockfish/pull/6899

No functional change
This commit is contained in:
zungur
2026-06-14 09:58:13 +02:00
committed by Disservin
parent ed8e35d759
commit f9beec5fa5
+1 -1
View File
@@ -1218,7 +1218,7 @@ void Position::update_piece_threats(Piece pc,
const Bitboard discovered = ray & (rAttacks | bAttacks) & occupiedNoK;
assert(!more_than_one(discovered));
if (discovered && (ray_pass_bb(sliderSq, s) & noRaysContaining) != noRaysContaining)
if (discovered && (ray & noRaysContaining) != noRaysContaining)
{
const Square threatenedSq = lsb(discovered);
const Piece threatenedPc = piece_on(threatenedSq);