projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
19a744a
)
Small speed-up in check detection
author
Fabian Fichter
<ianfab@users.noreply.github.com>
Thu, 31 Jan 2019 22:13:20 +0000 (23:13 +0100)
committer
Fabian Fichter
<ianfab@users.noreply.github.com>
Thu, 31 Jan 2019 22:13:20 +0000 (23:13 +0100)
Since pieces can not give check against own king.
No functional change.
src/position.cpp
patch
|
blob
|
history
diff --git
a/src/position.cpp
b/src/position.cpp
index
2b1863b
..
2b52675
100644
(file)
--- 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<KING>(them)) & pieces(us) : 0;
+ st->checkersBB = givesCheck ? attackers_to(square<KING>(them), us) & pieces(us) : 0;
// Update information about promoted pieces
if (type_of(m) != DROP && is_promoted(from))