-/// RootMove::insert_pv_in_tt() is called at the end of a search iteration, and
-/// inserts the PV back into the TT. This makes sure the old PV moves are searched
-/// first, even if the old TT entries have been overwritten.
-
-void RootMove::insert_pv_in_tt(Position& pos) {
-
- StateInfo state[MAX_PLY], *st = state;
- bool ttHit;
-
- for (Move m : pv)
- {
- assert(MoveList<LEGAL>(pos).contains(m));
-
- TTEntry* tte = TT.probe(pos.key(), ttHit);
-
- if (!ttHit || tte->move() != m) // Don't overwrite correct entries
- tte->save(pos.key(), VALUE_NONE, BOUND_NONE, DEPTH_NONE,
- m, VALUE_NONE, TT.generation());
-
- pos.do_move(m, *st++, pos.gives_check(m, CheckInfo(pos)));
- }
-
- for (size_t i = pv.size(); i > 0; )
- pos.undo_move(pv[--i]);
-}
-
-