mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 13:17:44 +00:00
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>
This commit is contained in:
@@ -275,7 +275,6 @@ Value do_evaluate(const Position& pos, Value& margin) {
|
||||
Value margins[2];
|
||||
Score score, mobilityWhite, mobilityBlack;
|
||||
|
||||
assert(pos.is_ok());
|
||||
assert(pos.thread() >= 0 && pos.thread() < MAX_THREADS);
|
||||
assert(!pos.in_check());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user