mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-19 00:26:33 +08:00
Save threadID info in Position
This is the best place because when we split we do a copy of the position and also threadID, once set in a given position, never changes anymore. Forbid use of Position's default and copy c'tor to avoid nasty bugs in case a position is created without explicitly setting the threadID. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -205,7 +205,7 @@ void TranspositionTable::new_search() {
|
||||
void TranspositionTable::insert_pv(const Position& pos, Move pv[]) {
|
||||
|
||||
StateInfo st;
|
||||
Position p(pos);
|
||||
Position p(pos, pos.thread());
|
||||
|
||||
for (int i = 0; pv[i] != MOVE_NONE; i++)
|
||||
{
|
||||
@@ -227,7 +227,7 @@ void TranspositionTable::extract_pv(const Position& pos, Move pv[], const int PL
|
||||
|
||||
const TTEntry* tte;
|
||||
StateInfo st;
|
||||
Position p(pos);
|
||||
Position p(pos, pos.thread());
|
||||
int ply = 0;
|
||||
|
||||
// Update position to the end of current PV
|
||||
|
||||
Reference in New Issue
Block a user