Skip to content

Commit

Permalink
Simplify evaluate_scale_factor()
Browse files Browse the repository at this point in the history
Code coverage with gcob shows that this path
is almost never taken, so try to simplify it
out.

bench: 5415646
  • Loading branch information
mcostalba committed Jul 15, 2017
1 parent e551afb commit 0484ada
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/evaluate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -781,17 +781,8 @@ namespace {
if (sf == SCALE_FACTOR_NORMAL || sf == SCALE_FACTOR_ONEPAWN)
{
if (pos.opposite_bishops())
{
// Endgame with opposite-colored bishops and no other pieces (ignoring pawns)
// is almost a draw, in case of KBP vs KB, it is even more a draw.
if ( pos.non_pawn_material(WHITE) == BishopValueMg
&& pos.non_pawn_material(BLACK) == BishopValueMg)
return more_than_one(pos.pieces(PAWN)) ? ScaleFactor(31) : ScaleFactor(9);

// Endgame with opposite-colored bishops, but also other pieces. Still
// a bit drawish, but not as drawish as with only the two bishops.
return ScaleFactor(46);
}

// Endings where weaker side can place his king in front of the opponent's
// pawns are drawish.
else if ( abs(eg) <= BishopValueEg
Expand Down

0 comments on commit 0484ada

Please sign in to comment.