glinscott/Stockfish — comment on commit 0347339970b68b998c7202e22c01560850dcd13e
File: src/endgame.cpp line 90
By glinscott:

Thanks for the quick review! Will have a new pull request in a bit.

I had missed MoveList. I put the check in its own function to allow the short-circuit when checking for legal moves. With MoveList that becomes quite unnecessary though :).

On Feb 5, 2012, at 11:08 AM, mcostalba wrote:

> Because we have the lone king I'd write simply:
>
> return pos.side_to_move() == c
> && !pos.in_check()
> && !MoveList(pos).size();
>
>
> I would even inline at the only call place so to be more clear what we aredoing and because we don't need a new function for a simple condition.
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/glinscott/Stockfish/commit/0347339970b68b998c7202e22c01560850dcd13e#commitcomment-934336