mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 18:46:59 +08:00
Small speed-up in BetweenBB
A speed-up removing some comparisons. closes https://github.com/official-stockfish/Stockfish/pull/2571 No functional change.
This commit is contained in:
committed by
Joost VandeVondele
parent
5a7b45eac9
commit
0424273d0b
@@ -199,8 +199,8 @@ inline Bitboard adjacent_files_bb(Square s) {
|
||||
/// If the given squares are not on a same file/rank/diagonal, return 0.
|
||||
|
||||
inline Bitboard between_bb(Square s1, Square s2) {
|
||||
return LineBB[s1][s2] & ( (AllSquares << (s1 + (s1 < s2)))
|
||||
^(AllSquares << (s2 + !(s1 < s2))));
|
||||
Bitboard b = LineBB[s1][s2] & ((AllSquares << s1) ^ (AllSquares << s2));
|
||||
return b & (b - 1); //exclude lsb
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user