mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 01:27:16 +08:00
Use opposite_color_squares() instead of same_color_squares()
It is almost alwasy the requested test and is a bit faster too. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -17,14 +17,9 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#if !defined(POSITION_H_INCLUDED)
|
||||
#define POSITION_H_INCLUDED
|
||||
|
||||
////
|
||||
//// Includes
|
||||
////
|
||||
|
||||
#include "bitboard.h"
|
||||
#include "color.h"
|
||||
#include "move.h"
|
||||
@@ -32,21 +27,11 @@
|
||||
#include "square.h"
|
||||
#include "value.h"
|
||||
|
||||
|
||||
////
|
||||
//// Constants
|
||||
////
|
||||
|
||||
/// Maximum number of plies per game (220 should be enough, because the
|
||||
/// maximum search depth is 100, and during position setup we reset the
|
||||
/// move counter for every non-reversible move).
|
||||
const int MaxGameLength = 220;
|
||||
|
||||
|
||||
////
|
||||
//// Types
|
||||
////
|
||||
|
||||
class Position;
|
||||
|
||||
/// struct checkInfo is initialized at c'tor time and keeps
|
||||
@@ -339,11 +324,6 @@ private:
|
||||
static const Value PieceValueEndgame[17];
|
||||
};
|
||||
|
||||
|
||||
////
|
||||
//// Inline functions
|
||||
////
|
||||
|
||||
inline int64_t Position::nodes_searched() const {
|
||||
return nodes;
|
||||
}
|
||||
@@ -538,9 +518,8 @@ inline int Position::startpos_ply_counter() const {
|
||||
|
||||
inline bool Position::opposite_colored_bishops() const {
|
||||
|
||||
return piece_count(WHITE, BISHOP) == 1
|
||||
&& piece_count(BLACK, BISHOP) == 1
|
||||
&& !same_color_squares(piece_list(WHITE, BISHOP, 0), piece_list(BLACK, BISHOP, 0));
|
||||
return piece_count(WHITE, BISHOP) == 1 && piece_count(BLACK, BISHOP) == 1
|
||||
&& opposite_color_squares(piece_list(WHITE, BISHOP, 0), piece_list(BLACK, BISHOP, 0));
|
||||
}
|
||||
|
||||
inline bool Position::has_pawn_on_7th(Color c) const {
|
||||
|
||||
Reference in New Issue
Block a user