From: Fabian Fichter Date: Thu, 22 Apr 2021 20:33:39 +0000 (+0200) Subject: Speed up pocket evaluation X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=6aefcd16485b968f4de8532a36bba90ff11187bd;p=fairystockfish.git Speed up pocket evaluation crazyhouse STC ELO: 23.77 +-6.7 (95%) LOS: 100.0% Total: 10000 W: 5176 L: 4493 D: 331 No functional change. --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index f09f4ca..23804b9 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -628,7 +628,7 @@ namespace { Score score = SCORE_ZERO; - if (pos.count_in_hand(Us, pt) > 0) + if (pos.count_in_hand(Us, pt) > 0 && pt != KING) { Bitboard b = pos.drop_region(Us, pt) & ~pos.pieces() & (~attackedBy2[Them] | attackedBy[Us][ALL_PIECES]); if ((b & kingRing[Them]) && pt != SHOGI_PAWN) @@ -1478,7 +1478,7 @@ namespace { // Evaluate pieces in hand once attack tables are complete if (pos.piece_drops() || pos.seirawan_gating()) - for (PieceType pt = PAWN; pt < KING; ++pt) + for (PieceType pt : pos.piece_types()) score += hand(pt) - hand(pt); score += (mobility[WHITE] - mobility[BLACK]) * (1 + pos.captures_to_hand() + pos.must_capture() + pos.check_counting());