File tree Expand file tree Collapse file tree 3 files changed +14
-22
lines changed
Expand file tree Collapse file tree 3 files changed +14
-22
lines changed Original file line number Diff line number Diff line change @@ -1376,7 +1376,6 @@ Value Position::compute_non_pawn_material(Color c) const {
13761376// / Position::is_draw() tests whether the position is drawn by material,
13771377// / repetition, or the 50 moves rule. It does not detect stalemates, this
13781378// / must be done by the search.
1379- template <bool SkipRepetition>
13801379bool Position::is_draw () const {
13811380
13821381 // Draw by material?
@@ -1389,33 +1388,26 @@ bool Position::is_draw() const {
13891388 return true ;
13901389
13911390 // Draw by repetition?
1392- if (!SkipRepetition)
1393- {
1394- int i = 4 , e = std::min (st->rule50 , st->pliesFromNull );
1391+ int i = 4 , e = std::min (st->rule50 , st->pliesFromNull );
13951392
1396- if (i <= e)
1397- {
1398- StateInfo* stp = st->previous ->previous ;
1393+ if (i <= e)
1394+ {
1395+ StateInfo* stp = st->previous ->previous ;
13991396
1400- do {
1401- stp = stp->previous ->previous ;
1397+ do {
1398+ stp = stp->previous ->previous ;
14021399
1403- if (stp->key == st->key )
1404- return true ;
1400+ if (stp->key == st->key )
1401+ return true ;
14051402
1406- i += 2 ;
1403+ i += 2 ;
14071404
1408- } while (i <= e);
1409- }
1405+ } while (i <= e);
14101406 }
14111407
14121408 return false ;
14131409}
14141410
1415- // Explicit template instantiations
1416- template bool Position::is_draw<false >() const ;
1417- template bool Position::is_draw<true >() const ;
1418-
14191411
14201412// / Position::flip() flips position with the white and black sides reversed. This
14211413// / is only useful for debugging especially for finding evaluation symmetry bugs.
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ class Position {
179179 Thread* this_thread () const ;
180180 int64_t nodes_searched () const ;
181181 void set_nodes_searched (int64_t n);
182- template < bool SkipRepetition> bool is_draw () const ;
182+ bool is_draw () const ;
183183
184184 // Position consistency check, for debugging
185185 bool pos_is_ok (int * failedStep = NULL ) const ;
Original file line number Diff line number Diff line change @@ -533,7 +533,7 @@ namespace {
533533 if (!RootNode)
534534 {
535535 // Step 2. Check for aborted search and immediate draw
536- if (Signals.stop || pos.is_draw < false > () || ss->ply > MAX_PLY)
536+ if (Signals.stop || pos.is_draw () || ss->ply > MAX_PLY)
537537 return DrawValue[pos.side_to_move ()];
538538
539539 // Step 3. Mate distance pruning. Even if we mate at the next move our score
@@ -1129,7 +1129,7 @@ namespace {
11291129 ss->ply = (ss-1 )->ply + 1 ;
11301130
11311131 // Check for an instant draw or maximum ply reached
1132- if (pos.is_draw < false > () || ss->ply > MAX_PLY)
1132+ if (pos.is_draw () || ss->ply > MAX_PLY)
11331133 return DrawValue[pos.side_to_move ()];
11341134
11351135 // Decide whether or not to include checks, this fixes also the type of
@@ -1579,7 +1579,7 @@ void RootMove::extract_pv_from_tt(Position& pos) {
15791579 && pos.is_pseudo_legal (m = tte->move ()) // Local copy, TT could change
15801580 && pos.pl_move_is_legal (m, pos.pinned_pieces ())
15811581 && ply < MAX_PLY
1582- && (!pos.is_draw < false > () || ply < 2 ));
1582+ && (!pos.is_draw () || ply < 2 ));
15831583
15841584 pv.push_back (MOVE_NONE); // Must be zero-terminating
15851585
You can’t perform that action at this time.
0 commit comments