projects
/
stockfish
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ca0804d
)
Small simplification in gives_check
author
Marco Costalba
<mcostalba@gmail.com>
Tue, 11 Mar 2014 21:58:08 +0000
(22:58 +0100)
committer
Marco Costalba
<mcostalba@gmail.com>
Tue, 11 Mar 2014 21:58:08 +0000
(22:58 +0100)
Use switch statement also for normal case.
No speed regression.
No functional change.
src/position.cpp
patch
|
blob
|
history
diff --git
a/src/position.cpp
b/src/position.cpp
index 3fc568eebf93a0e674d748ceee4095c8b92b7551..1cb64934e95c2ace279d78a5d31f9a5e5c9a4f77 100644
(file)
--- a/
src/position.cpp
+++ b/
src/position.cpp
@@
-596,12
+596,11
@@
bool Position::gives_check(Move m, const CheckInfo& ci) const {
&& !aligned(from, to, ci.ksq))
return true;
- // Can we skip the ugly special cases?
- if (type_of(m) == NORMAL)
- return false;
-
switch (type_of(m))
{
+ case NORMAL:
+ return false;
+
case PROMOTION:
return attacks_bb(Piece(promotion_type(m)), to, pieces() ^ from) & ci.ksq;