Rewrite do_null_move()

Use a more traditional approach, along the same lines
of do_move().

It is true that we copy more in do_null_move(), but we
save the work in undo_null_move(). Speed test shows the
new code to be even a bit faster.

No functional change.
This commit is contained in:
Marco Costalba
2013-01-27 11:45:01 +01:00
parent 76a0d3c05a
commit 2218a5836a
3 changed files with 35 additions and 44 deletions
+2 -2
View File
@@ -667,12 +667,12 @@ namespace {
if (eval - PawnValueMg > beta)
R += ONE_PLY;
pos.do_null_move<true>(st);
pos.do_null_move(st);
(ss+1)->skipNullMove = true;
nullValue = depth-R < ONE_PLY ? -qsearch<NonPV, false>(pos, ss+1, -beta, -alpha, DEPTH_ZERO)
: - search<NonPV>(pos, ss+1, -beta, -alpha, depth-R);
(ss+1)->skipNullMove = false;
pos.do_null_move<false>(st);
pos.undo_null_move();
if (nullValue >= beta)
{