From cf5b42efe3c0b9eae2b1aa9568299e214f8ba2d9 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Thu, 31 Jan 2019 23:13:20 +0100 Subject: [PATCH] Small speed-up in check detection Since pieces can not give check against own king. No functional change. --- src/position.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 2b1863b..2b52675 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1233,7 +1233,7 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) { st->key = k; // Calculate checkers bitboard (if move gives check) - st->checkersBB = givesCheck ? attackers_to(square(them)) & pieces(us) : 0; + st->checkersBB = givesCheck ? attackers_to(square(them), us) & pieces(us) : 0; // Update information about promoted pieces if (type_of(m) != DROP && is_promoted(from)) -- 1.7.0.4