Move halfOpenFiles[] calculation out of a loop

And put it in an already existing one so to
optimze a bit.

Also additional cleanups and code shuffles
all around the place.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-07-27 11:28:29 +02:00
parent 565d12bf42
commit 23ceb66950
3 changed files with 67 additions and 90 deletions
+2 -13
View File
@@ -58,7 +58,7 @@ public:
int get_king_shelter(const Position& pos, Color c, Square ksq);
private:
inline void clear();
void clear();
int updateShelter(const Position& pos, Color c, Square ksq);
Key key;
@@ -67,7 +67,7 @@ private:
int16_t ksStormValue[2], qsStormValue[2];
uint8_t halfOpenFiles[2];
Square kingSquares[2];
int16_t kingShelters[2];
uint8_t kingShelters[2];
};
/// The PawnInfoTable class represents a pawn hash table. It is basically
@@ -128,15 +128,4 @@ inline int PawnInfo::get_king_shelter(const Position& pos, Color c, Square ksq)
return (kingSquares[c] == ksq ? kingShelters[c] : updateShelter(pos, c, ksq));
}
inline void PawnInfo::clear() {
passedPawns = EmptyBoardBB;
mgValue = egValue = 0;
ksStormValue[WHITE] = ksStormValue[BLACK] = 0;
qsStormValue[WHITE] = qsStormValue[BLACK] = 0;
halfOpenFiles[WHITE] = halfOpenFiles[BLACK] = 0xFF;
kingSquares[WHITE] = kingSquares[BLACK] = SQ_NONE;
}
#endif // !defined(PAWNS_H_INCLUDED)