]> git.sesse.net Git - stockfish/commit
Micro-optimize color_of()
authorMarco Costalba <mcostalba@gmail.com>
Wed, 5 Dec 2012 10:05:32 +0000 (11:05 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 8 Dec 2012 11:32:48 +0000 (12:32 +0100)
commit22c557ca7ce957cfb164c56dd149f22e2f11c7f9
tree72131e8f57f699d42af69606b01ffb5db4aabcf3
parent6a934882915f85c9f22c0bc60df6dbd469d89f10
Micro-optimize color_of()

In almost all cases we already know in advance that
color_of() argument is different from NO_PIECE.

So avoid the check for NO_PIECE in color_of() and
test at caller site in the very few places where
this case could occur.

As a nice side effect, this patch fixes a (bogus)
warning under some versions of gcc.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/position.cpp
src/types.h