Skip to content

Commit f8e8424

Browse files
committed
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. No functional change
1 parent 86f1df7 commit f8e8424

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/position.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1222,7 +1222,7 @@ void Position::update_piece_threats(Piece pc,
12221222
const Bitboard discovered = ray & (rAttacks | bAttacks) & occupiedNoK;
12231223

12241224
assert(!more_than_one(discovered));
1225-
if (discovered && (ray_pass_bb(sliderSq, s) & noRaysContaining) != noRaysContaining)
1225+
if (discovered && (ray & noRaysContaining) != noRaysContaining)
12261226
{
12271227
const Square threatenedSq = lsb(discovered);
12281228
const Piece threatenedPc = piece_on(threatenedSq);

0 commit comments

Comments
 (0)