Use pointers instead of array indices in MovePicker

This avoids calculating the array entry position
at each access and gives another boost of almost 1%.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-08-28 08:57:52 +02:00
parent 6cf28d4aa7
commit 9e4befe3f1
7 changed files with 106 additions and 109 deletions

View File

@@ -81,9 +81,10 @@ private:
const History& H;
Move ttMoves[2], killers[2];
const MovegenPhaseT* phasePtr;
int phase, movesPicked, numOfMoves, numOfBadCaptures;
int phase, movesPicked, numOfBadCaptures;
bool finished;
Bitboard dc, pinned;
MoveStack *curMove, *lastMove;
MoveStack moves[256], badCaptures[64];
};
@@ -98,7 +99,7 @@ private:
/// a single reply to check.
inline int MovePicker::number_of_moves() const {
return numOfMoves;
return int(lastMove - moves);
}
/// MovePicker::discovered_check_candidates() returns a bitboard containing