forked from official-stockfish/Stockfish
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bench 3110425
- Loading branch information
Showing
1 changed file
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
02092ac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MJZ1977
This patch have the problem that the lsb and msb functions are not well defined if the argument is zero (which is the case if the pawn unopposed).
Also its better to use the function backmost_sq instead of lsb and msb. This is more readable and hides the use of lsb and msb.
So following code would be correct and more readable:
if (opposed) e->pawnAttacksSpan[Us] |= pawn_attack_span(Us, s) & ~pawn_attack_span(Us, backmost_sq(Us, theirPawns & forward_file_bb(Us, s))); else e->pawnAttacksSpan[Us] |= pawn_attack_span(Us, s);
02092ac
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for advice !