Skip to content

Commit

Permalink
max_piece_type cleanup, and slight speed increase.
Browse files Browse the repository at this point in the history
No functional change.

Resolves #81
  • Loading branch information
mstembera authored and glinscott committed Oct 28, 2014
1 parent 7d42752 commit 5605cc7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/evaluate.cpp
Expand Up @@ -499,12 +499,11 @@ namespace {

assert(target & (pos.pieces(C) ^ pos.pieces(C, KING)));

PieceType pt;
for (pt = QUEEN; pt > PAWN; --pt)
for (PieceType pt = QUEEN; pt > PAWN; --pt)
if (target & pos.pieces(C, pt))
return pt;

return pt;
return PAWN;
}


Expand Down

2 comments on commit 5605cc7

@AlexandreMasta
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not

return pt;

?

@mcostalba
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pt is always equal to PAWN at that point in the code.

Please sign in to comment.