]> git.sesse.net Git - stockfish/commit
Change the flow in wich moves are generated and picked
authorMarco Costalba <mcostalba@gmail.com>
Thu, 27 Aug 2009 07:12:51 +0000 (09:12 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Thu, 27 Aug 2009 18:56:26 +0000 (19:56 +0100)
commit6cf28d4aa733447373430708fd2c35dee4469b10
treee53b7910478bd509e9cc9e37c5d6b163a4f46850
parent129cde008c4b03cb129e4b3a0e048f3772f530eb
Change the flow in wich moves are generated and picked

In MovePicker we get the next move with pick_move_from_list(),
then check if the return value is equal to MOVE_NONE and
in this case we update the state to the new phase.

This patch reorders the flow so that now from pick_move_from_list()
renamed get_next_move() we directly call go_next_phase() to
generate and sort the next bunch of moves when there are no more
move to try. This avoids to always check for pick_move_from_list()
returned value and the flow is more linear and natural.

Also use a local variable instead of a pointer dereferencing in a
time critical switch statement in get_next_move()

With this patch alone we have an incredible speed up of 3.2% !!!

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/movepick.cpp
src/movepick.h