Retire quietsSearched[]

Use MovePicker moves[] to access already tried
quiet moves. A bit of care shall be taken
to avoid calling stage_moves() when we are still
at ttMove stage, because moves are yet to be
generated. Actually our staging move generation
makes this code a bit more tricky than what I'd
like, but removing an ausiliary redundant
array like quietsSearched[] is a good thing.

Idea by DiscoCheck

bench: 9355734
This commit is contained in:
Marco Costalba
2013-11-17 09:12:19 +01:00
parent 9763c69fa5
commit d9c7cad630
3 changed files with 16 additions and 10 deletions

View File

@@ -140,6 +140,15 @@ MovePicker::MovePicker(const Position& p, Move ttm, const HistoryStats& h, Piece
}
/// stage_moves() returns a pointer to the beginning of moves array. It
/// is used to access already tried quiet moves when updating history.
const ExtMove* MovePicker::stage_moves() const {
assert(stage == KILLERS_S1 || stage == QUIETS_1_S1 || stage == QUIETS_2_S1);
return stage == KILLERS_S1 ? killers : moves;
}
/// score() assign a numerical move ordering score to each move in a move list.
/// The moves with highest scores will be picked first.
template<>