1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 08:43:09 +00:00

Remove unneeded condition. (#2057)

This is covered by the line just before. If we would like to protect
against the piece value of e.g. a N == B, this could be done by an
assert, no need to do this at runtime.

No functional change.
This commit is contained in:
Joost VandeVondele 2019-03-24 17:40:29 +01:00 committed by Marco Costalba
parent ea5505821d
commit 2f11c03bbf

View file

@ -70,14 +70,12 @@ namespace {
bool is_KBPsK(const Position& pos, Color us) { bool is_KBPsK(const Position& pos, Color us) {
return pos.non_pawn_material(us) == BishopValueMg return pos.non_pawn_material(us) == BishopValueMg
&& pos.count<BISHOP>(us) == 1
&& pos.count<PAWN >(us) >= 1; && pos.count<PAWN >(us) >= 1;
} }
bool is_KQKRPs(const Position& pos, Color us) { bool is_KQKRPs(const Position& pos, Color us) {
return !pos.count<PAWN>(us) return !pos.count<PAWN>(us)
&& pos.non_pawn_material(us) == QueenValueMg && pos.non_pawn_material(us) == QueenValueMg
&& pos.count<QUEEN>(us) == 1
&& pos.count<ROOK>(~us) == 1 && pos.count<ROOK>(~us) == 1
&& pos.count<PAWN>(~us) >= 1; && pos.count<PAWN>(~us) >= 1;
} }