From f9beec5fa56540ee088a9c9e03a6444b4ec26af6 Mon Sep 17 00:00:00 2001 From: zungur Date: Sun, 14 Jun 2026 09:50:31 +0200 Subject: [PATCH] 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 --- src/position.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/position.cpp b/src/position.cpp index a481286aa..d13f8472e 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -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);