1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00: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:
protonspring 2020-03-03 16:35:45 -07:00 committed by Joost VandeVondele
parent 5a7b45eac9
commit 0424273d0b

View file

@ -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
}