Move npMaterial[2] to StateInfo in Position

So to have a bit faster undo_move() and also
a code semplification.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-05-21 09:47:03 +02:00
parent 20c2a31464
commit 5603e25a7f
2 changed files with 17 additions and 28 deletions

View File

@@ -91,6 +91,7 @@ struct StateInfo {
int castleRights, rule50;
Square epSquare;
Value mgValue, egValue;
Value npMaterial[2];
PieceType capture;
Bitboard checkersBB;
@@ -353,7 +354,6 @@ private:
Color sideToMove;
int gamePly;
Key history[MaxGameLength];
Value npMaterial[2];
File initialKFile, initialKRFile, initialQRFile;
StateInfo startState;
StateInfo* st;
@@ -651,7 +651,7 @@ inline Value Position::eg_value() const {
}
inline Value Position::non_pawn_material(Color c) const {
return npMaterial[c];
return st->npMaterial[c];
}
inline Phase Position::game_phase() const {