From: Marco Costalba Date: Tue, 11 Mar 2014 21:58:08 +0000 (+0100) Subject: Small simplification in gives_check X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=c40d4e0133d003f6caec8fd3bb0bab21f9298721;ds=sidebyside Small simplification in gives_check Use switch statement also for normal case. No speed regression. No functional change. --- diff --git a/src/position.cpp b/src/position.cpp index 3fc568ee..1cb64934 100644 --- 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;