@@ -342,12 +342,12 @@ void Search::UpdateKLDGain() {
342342 if (prev_dist_.size () != 0 ) {
343343 double sum1 = 0.0 ;
344344 double sum2 = 0.0 ;
345- for (int i = 0 ; i < new_visits.size (); i++) {
345+ for (decltype (new_visits)::size_type i = 0 ; i < new_visits.size (); i++) {
346346 sum1 += prev_dist_[i];
347347 sum2 += new_visits[i];
348348 }
349349 double kldgain = 0.0 ;
350- for (int i = 0 ; i < new_visits.size (); i++) {
350+ for (decltype (new_visits)::size_type i = 0 ; i < new_visits.size (); i++) {
351351 double o_p = prev_dist_[i] / sum1;
352352 double n_p = new_visits[i] / sum2;
353353 if (prev_dist_[i] != 0 ) {
@@ -437,8 +437,8 @@ void Search::UpdateRemainingMoves() {
437437 if (time_since_start > kSmartPruningToleranceMs ) {
438438 const auto nps = 1000LL *
439439 (total_playouts_ + kSmartPruningToleranceNodes ) /
440- time_since_start +
441- 1 ;
440+ time_since_start +
441+ 1 ;
442442 const int64_t remaining_time = GetTimeToDeadline ();
443443 // Put early_exit scaler here so calculation doesn't have to be done on
444444 // every node.
@@ -454,8 +454,8 @@ void Search::UpdateRemainingMoves() {
454454 // Add kMiniBatchSize, as it's possible to exceed visits limit by that
455455 // number.
456456 const auto remaining_visits = limits_.visits - total_playouts_ -
457- initial_visits_ +
458- params_. GetMiniBatchSize () - 1 ;
457+ initial_visits_ + params_. GetMiniBatchSize () -
458+ 1 ;
459459
460460 if (remaining_visits < remaining_playouts_)
461461 remaining_playouts_ = remaining_visits;
@@ -516,15 +516,12 @@ int Search::PopulateRootMoveLimit(MoveList* root_moves) const {
516516 (board.ours () | board.theirs ()).count () > syzygy_tb_->max_cardinality ()) {
517517 return 0 ;
518518 }
519-
520- int best_rank = syzygy_tb_->root_probe (
521- played_history_.Last (),
522- params_.GetSyzygyFastPlay () ||
523- played_history_.DidRepeatSinceLastZeroingMove (),
524- root_moves);
525- if (!best_rank)
526- best_rank = syzygy_tb_->root_probe_wdl (played_history_.Last (), root_moves);
527- return best_rank;
519+ return syzygy_tb_->root_probe (
520+ played_history_.Last (),
521+ params_.GetSyzygyFastPlay () ||
522+ played_history_.DidRepeatSinceLastZeroingMove (),
523+ root_moves) ||
524+ syzygy_tb_->root_probe_wdl (played_history_.Last (), root_moves);
528525}
529526
530527// Computes the best move, maybe with temperature (according to the settings).
@@ -606,7 +603,7 @@ std::vector<EdgeAndNode> Search::GetBestChildrenNoTemperature(Node* parent,
606603 // Final sort pass.
607604 const auto middle = (static_cast <int >(edges.size ()) > count)
608605 ? edges.begin () + count
609- : edges.end ();
606+ : edges.end ();
610607 std::partial_sort (edges.begin (), middle, edges.end (), std::greater<El>());
611608
612609 std::vector<EdgeAndNode> res;
0 commit comments