mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-26 20:16:14 +08:00
Explicitly pass RootMoves to TB probes
Currently Search::RootMoves is accessed and even modified by TB probing functions in a hidden and sneaky way. This is bad practice and makes the code tricky. Instead explicily pass the vector as function argument so to clarify that the vector is modified inside the functions. No functional change.
This commit is contained in:
committed by
Joona Kiiski
parent
eeb6d923fa
commit
ba1464751d
@@ -223,8 +223,8 @@ static void init_tb(char *str)
|
||||
entry->num += pcs[i];
|
||||
entry->symmetric = (key == key2);
|
||||
entry->has_pawns = (pcs[TB_WPAWN] + pcs[TB_BPAWN] > 0);
|
||||
if (entry->num > Tablebases::TBLargest)
|
||||
Tablebases::TBLargest = entry->num;
|
||||
if (entry->num > Tablebases::MaxCardinality)
|
||||
Tablebases::MaxCardinality = entry->num;
|
||||
|
||||
if (entry->has_pawns) {
|
||||
struct TBEntry_pawn *ptr = (struct TBEntry_pawn *)entry;
|
||||
@@ -301,7 +301,7 @@ void Tablebases::init(const std::string& path)
|
||||
LOCK_INIT(TB_mutex);
|
||||
|
||||
TBnum_piece = TBnum_pawn = 0;
|
||||
TBLargest = 0;
|
||||
MaxCardinality = 0;
|
||||
|
||||
for (i = 0; i < (1 << TBHASHBITS); i++)
|
||||
for (j = 0; j < HSHMAX; j++) {
|
||||
|
||||
Reference in New Issue
Block a user