bb: Refactor in_how_many_mills()
This commit is contained in:
parent
c4c3340e9d
commit
de6ee73d55
|
@ -1597,18 +1597,23 @@ int Position::in_how_many_mills(Square s, Color c, Square squareSelected)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int l = 0; l < LD_NB; l++) {
|
#ifndef DISABLE_BITBOARD
|
||||||
#ifdef DISABLE_BITBOARD
|
Bitboard bc = byColorBB[c];
|
||||||
bool b = make_piece(c) &
|
Bitboard *mt = millTableBB[s];
|
||||||
board[millTable[s][l][0]] &
|
|
||||||
board[millTable[s][l][1]];
|
|
||||||
#else
|
|
||||||
bool b = ((byColorBB[c] & millTableBB[s][l]) == millTableBB[s][l]);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (b) {
|
for (int l = 0; l < LD_NB; l++) {
|
||||||
|
#ifdef DISABLE_BITBOARD
|
||||||
|
if (make_piece(c) &
|
||||||
|
board[millTable[s][l][0]] &
|
||||||
|
board[millTable[s][l][1]]) {
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
if ((bc & mt[l]) == mt[l]) {
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (squareSelected != SQ_0) {
|
if (squareSelected != SQ_0) {
|
||||||
|
@ -1629,10 +1634,10 @@ int Position::add_mills(Square s)
|
||||||
|
|
||||||
#ifdef DISABLE_BITBOARD
|
#ifdef DISABLE_BITBOARD
|
||||||
int idx[3], min, temp;
|
int idx[3], min, temp;
|
||||||
#endif
|
#else
|
||||||
|
|
||||||
Bitboard bc = byColorBB[color_on(s)];
|
Bitboard bc = byColorBB[color_on(s)];
|
||||||
Bitboard *mt = millTableBB[s];
|
Bitboard *mt = millTableBB[s];
|
||||||
|
#endif
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (int i = 0; i < 3; i++) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue