mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 00:26:33 +08:00
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>
This commit is contained in:
@@ -176,10 +176,10 @@ int generate_noncaptures(const Position& pos, MoveStack* mlist) {
|
||||
}
|
||||
|
||||
|
||||
/// generate_checks() generates all pseudo-legal non-capturing, non-promoting
|
||||
/// checks. It returns the number of generated moves.
|
||||
/// generate_non_capture_checks() generates all pseudo-legal non-capturing,
|
||||
/// non-promoting checks. It returns the number of generated moves.
|
||||
|
||||
int generate_checks(const Position& pos, MoveStack* mlist, Bitboard dc) {
|
||||
int generate_non_capture_checks(const Position& pos, MoveStack* mlist, Bitboard dc) {
|
||||
|
||||
assert(pos.is_ok());
|
||||
assert(!pos.is_check());
|
||||
|
||||
Reference in New Issue
Block a user