Greatly speedup has_mate_threat()
authorMarco Costalba <mcostalba@gmail.com>
Mon, 20 Apr 2009 07:10:27 +0000 (09:10 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 26 Apr 2009 12:40:26 +0000 (13:40 +0100)
commit7c267587fc7f454182b4d527607bcf8fdbd8c41c
treecd875e1c540cdb26638a15f10ee2ceb07ccb01f4
parent24485c96ec7dcb743c1dac8cf0cccc96456893d9
Greatly speedup has_mate_threat()

Instead of loop across all legal moves to find a mate
loop across possible check moves only.

This reduces more then 10 times the number of moves to
check for a possible mate.

Also rename generate_checks() in generate_non_capture_checks()
so to better clarify what the function does.

No functional change.

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