Skip to content

Commit 08a815d

Browse files
authored
using the precomputed king mask
1 parent c100a37 commit 08a815d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

chess/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ def king(self, color: Color) -> Optional[Square]:
916916
considered.
917917
"""
918918
king_mask = self.occupied_co[color] & self.kings & ~self.promoted
919-
return msb(king_mask) if king_mask and popcount(self.kings) == 1 else None
919+
return msb(king_mask) if king_mask and popcount(king_mask) == 1 else None
920920

921921
def attacks_mask(self, square: Square) -> Bitboard:
922922
bb_square = BB_SQUARES[square]

0 commit comments

Comments
 (0)