Move kingSquare[] array to StateInfo

This avoids to reverting back when undoing the move.

No functional change. No performance change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-09-20 07:04:22 +01:00
parent 7c55b0e880
commit c5f44ef45b
2 changed files with 11 additions and 20 deletions

View File

@@ -89,7 +89,7 @@ enum Phase {
struct StateInfo {
Key key, pawnKey, materialKey;
int castleRights, rule50;
Square epSquare;
Square kingSquare[2], epSquare;
Value mgValue, egValue;
Value npMaterial[2];
@@ -326,7 +326,6 @@ private:
int index[64]; // [square]
// Other info
Square kingSquare[2];
Color sideToMove;
int gamePly;
Key history[MaxGameLength];
@@ -423,7 +422,7 @@ inline Square Position::ep_square() const {
}
inline Square Position::king_square(Color c) const {
return kingSquare[c];
return st->kingSquare[c];
}
inline bool Position::can_castle_kingside(Color side) const {