]> git.sesse.net Git - stockfish/commit
Don't need to assert for pos.is_ok() when position is constant
authorMarco Costalba <mcostalba@gmail.com>
Sat, 16 Jul 2011 09:42:27 +0000 (10:42 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 16 Jul 2011 09:53:34 +0000 (10:53 +0100)
commit67686b7684e8cb2f195a648b1042e671e80bc9be
tree0063ee67c3149002f1d4d46319f4e311f71787d7
parent69f4954df1de3ed264212a6e871986781d717e08
Don't need to assert for pos.is_ok() when position is constant

It's only necessary to do the checking at the end of every non-const
member (including the constructors and from_fen()) of class Position.
Once the post-condition of every modifier guarantees the class invariant,
we don't need to verify sanity of the position as preconditions for outside
callers such as movegen, search etc. For non-class types such as Move and
Square we still need to assert of course.

Suggested by Rein Halbersma.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/evaluate.cpp
src/move.cpp
src/movegen.cpp
src/pawns.cpp
src/position.cpp
src/position.h
src/uci.cpp